Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
KGosha
Contributor
Contributor

How to join multiple tables

Hello, as a newcomer to Qlik Sense, I'm in need of some assistance with joining tables. Specifically, I'm attempting to join three tables  (Work Orders, Work OrderLines, and Parts Orders) into one, but the output only shows the content of the first table. (Final_Temp_1)  Can you help me with this issue?

 

Final_Temp_1:
Load
Work_Order_Name                                                                                                       as  WONumber,
Work_Order_Type                                                                                                         as WOType,
Work_Order_Installed_Product_Item_Number                                              as WOItemNumber,
Work_Order_Id_Key                                                                                                     as WOKey,
FROM [lib://Work_Order.qvd]
(qvd);


left Join (Final_Temp_1)
Load
Work_OL_Name                                                                                               as WOLineNumber,
date(floor(Work_OL_Created_Date))                                                      as WOLCreatedDate,
Work_OL_Line_Type                                                                                      as WOLineType,
Work_OL_Item_Number                                                                              as WOLItemNumber,
Work_OL_Line_Status                                                                                   as WOLineStatus,
Work_OL_Actual_Quantity                                                                          as WOLQuantity,
Work_Order_Id_Key                                                                                       as WOKey
FROM [lib://Work_Order_Line.qvd]
(qvd);

Final_Temp_2:
Load
Work_Order_Name                                                                                     as WONumber,
Work_Order_Type                                                                                       as WOType,
Work_Order_Installed_Product_Item_Number                             as WOItemNumber,
Work_Order_Id_Key                                                                                    as WOKey
FROM [lib://Work_Order.qvd]
(qvd);


left join (Final_Temp_2)
Load
Parts_Order_Name                                                                                                    as PartsOrderNumber,
date(floor(Parts_Order_CreatedDate))                                                             as PartsOrderCreatedDate,
text(trim(Parts_Order_Movex_ID__c))                                                              as SystemID,
Parts_Order_Case_Number__c                                                                           as PartsOrderCaseNumber,
Parts_Order_SVMXC__Number_of_units_returned__c                           as PartsOrderQuantity,
Parts_Order_Country_CSCD__c                                                                         as PartsOrderCountry,
text(Parts_Order_SVMXC__Service_Order__c)                                            as WOKey

FROM [lib://artsOrders.qvd]
(qvd);

Final:
NoConcatenate
LOAD *
Resident Final_Temp_1;

Concatenate (Final)
LOAD *
Resident Final_Temp_2;

DROP Tables Final_Temp_1, Final_Temp_2 ;

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda

@KGosha  not sure why you need temp table 2 and why you need to concatenate ? It seems Work_Order_Line is your Fact table and other two are dimension table so you can simply join both dimension table to Fact table. Note that first you need to load Fact table then join dimension table

WOL:

LOAD Work_OL_Name                                                                                   as WOLineNumber,
date(floor(Work_OL_Created_Date))                                                      as WOLCreatedDate,
Work_OL_Line_Type                                                                                      as WOLineType,
Work_OL_Item_Number                                                                              as WOLItemNumber,
Work_OL_Line_Status                                                                                   as WOLineStatus,
Work_OL_Actual_Quantity                                                                          as WOLQuantity,
Work_Order_Id_Key                                                                                       as WOKey
FROM [lib://Work_Order_Line.qvd]
(qvd);

left join(WOL)
Load
Work_Order_Name                                                                                                       as  WONumber,
Work_Order_Type                                                                                                         as WOType,
Work_Order_Installed_Product_Item_Number                                              as WOItemNumber,
Work_Order_Id_Key                                                                                                     as WOKey
FROM [lib://Work_Order.qvd]
(qvd);


left join (WOL)
Load
Parts_Order_Name                                                                                                    as PartsOrderNumber,
date(floor(Parts_Order_CreatedDate))                                                             as PartsOrderCreatedDate,
text(trim(Parts_Order_Movex_ID__c))                                                              as SystemID,
Parts_Order_Case_Number__c                                                                           as PartsOrderCaseNumber,
Parts_Order_SVMXC__Number_of_units_returned__c                           as PartsOrderQuantity,
Parts_Order_Country_CSCD__c                                                                         as PartsOrderCountry,
text(Parts_Order_SVMXC__Service_Order__c)                                            as WOKey

FROM [lib://artsOrders.qvd]
(qvd);

View solution in original post

7 Replies
KGosha
Contributor
Contributor
Author

Hello,

Thank you for the quick reply.

I followed your suggestions, but I'm still getting no data on the parts order information.

KGosha_0-1685640260541.png

 

 

KGosha
Contributor
Contributor
Author

When I created the relationships between the tables it appeared to be the same format.  The below is from the data model viewer.

 KGosha_0-1685642048625.png

Work Order Table

KGosha_1-1685642070945.png

Work Orderline Table:

KGosha_2-1685642087677.png

Please advise if you require additional information.

 

 

 

KGosha
Contributor
Contributor
Author

Unfortunately, I am unable to share the file with you. However, I can assure you that all of the fields have a density of over 90%. Would you like any additional information, or should I create a mock table resembling the information loaded?

BrunPierre
Partner - Master
Partner - Master

This will definitely help with troubleshooting.

Kushal_Chawda

@KGosha  not sure why you need temp table 2 and why you need to concatenate ? It seems Work_Order_Line is your Fact table and other two are dimension table so you can simply join both dimension table to Fact table. Note that first you need to load Fact table then join dimension table

WOL:

LOAD Work_OL_Name                                                                                   as WOLineNumber,
date(floor(Work_OL_Created_Date))                                                      as WOLCreatedDate,
Work_OL_Line_Type                                                                                      as WOLineType,
Work_OL_Item_Number                                                                              as WOLItemNumber,
Work_OL_Line_Status                                                                                   as WOLineStatus,
Work_OL_Actual_Quantity                                                                          as WOLQuantity,
Work_Order_Id_Key                                                                                       as WOKey
FROM [lib://Work_Order_Line.qvd]
(qvd);

left join(WOL)
Load
Work_Order_Name                                                                                                       as  WONumber,
Work_Order_Type                                                                                                         as WOType,
Work_Order_Installed_Product_Item_Number                                              as WOItemNumber,
Work_Order_Id_Key                                                                                                     as WOKey
FROM [lib://Work_Order.qvd]
(qvd);


left join (WOL)
Load
Parts_Order_Name                                                                                                    as PartsOrderNumber,
date(floor(Parts_Order_CreatedDate))                                                             as PartsOrderCreatedDate,
text(trim(Parts_Order_Movex_ID__c))                                                              as SystemID,
Parts_Order_Case_Number__c                                                                           as PartsOrderCaseNumber,
Parts_Order_SVMXC__Number_of_units_returned__c                           as PartsOrderQuantity,
Parts_Order_Country_CSCD__c                                                                         as PartsOrderCountry,
text(Parts_Order_SVMXC__Service_Order__c)                                            as WOKey

FROM [lib://artsOrders.qvd]
(qvd);

KGosha
Contributor
Contributor
Author

@Kushal_Chawda This functions flawlessly. I appreciate your assistance. Thank you!

KGosha
Contributor
Contributor
Author

Thank you for assisting.  It has now been resolved.