Logical Tables » Logical view examples » Business case 2: Attribute form expression across multiple tables

Business case 2: Attribute form expression across multiple tables

Customers often request the ability to generate an attribute form expression across multiple tables. Usually, the case is on Date columns. For example, you want to define an attribute based on the Date difference between two Date columns (Ship_Date and Order_Date) in two different tables as follows.

F_Table1

Ship_Date

Order_ID

Fact1

 

 

 

F_Table2

Order_Date

Order_ID

Fact2

 

 

 

Using the Logical View feature, you can use the following SQL query to create a logical table to calculate the Date difference and then define the attribute on that new column:

Select Ship_Date-Order_Date Cycle_time,
F_table1.Order_ID, Fact1, Fact2
From F_table1, F_table2
Where F_table1.Order_ID=F_table2.Order_ID

The new logical table (logical view) looks like the following table, and a new attribute can be defined on the Cycle_Time column.

Logical view

Cycle_Time

Order_ID

Fact1

Fact2