Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi community,
i'm new to Qlik and SQL, and facing a trouble.
i am trying to join two tables from different source, but cannot achieve it.
i can join two tables from same source, but cannot in case from different source.
what is the best way to join tables from different source? i feel multiple "lib connect to" statement makes me confused.
my dataload script is like below:
LIB CONNECT TO sourceA;
LOAD
ItemID, WEIGHT
from tableA
;
LIB CONNECT TO sourceB
LOAD
targetID, machinePG
from tableB
INNER JOIN (tableA)
ON tableA.itemID=tableB.targetID
tableA: LOAD ItemID, WEIGHT inline [ ItemID, WEIGHT 1,10 2,20 ] ; INNER JOIN (tableA) LOAD targetID as ItemID, machinePG inline [ targetID, machinePG 1,1 3,4 ] ;
Qlik engine joins on table name. In code sample i've used load inline syntax. It will work with libs also.
tableA: LOAD ItemID, WEIGHT inline [ ItemID, WEIGHT 1,10 2,20 ] ; INNER JOIN (tableA) LOAD targetID as ItemID, machinePG inline [ targetID, machinePG 1,1 3,4 ] ;
Qlik engine joins on table name. In code sample i've used load inline syntax. It will work with libs also.
LIB CONNECT TO sourceA;
TableA:
LOAD
ItemID,
WEIGHT
FROM tableA;
LIB CONNECT TO sourceB;
TableB:
LOAD
targetID as ItemID, // Rename 'targetID' to 'ItemID' to create an association based on the same field name
machinePG
FROM tableB;