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: 
CK_WAKE
Creator
Creator

Append two tables to one when the primary key do not match

I have two Q VD files (table1, table2) with the same column names, and I would like to append them into a single table called "final_table". The append operation should only occur when the primary keys do not match from both tables. However, with the current code, I am only seeing IDs from table1 appear, and IDs from table2 are not being included.

I would appreciate your guidance in resolving this issue.

 

LOAD *
From table1;
Concatenate LOAD * FROM table2
WHERE NOT Exists(id);

Labels (5)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

Try

Table1:
LOAD ID as LookUpID
...
FROM abc;

Concatenate

Table2:
LOAD ID
...
FROM xyz;

NoConcatenate
Final_Table:
LOAD * Resident
Where not Exists(IDToCheck,ID);

DROP Table Table1;

DROP Field LookUpID;

View solution in original post

2 Replies
BrunPierre
Partner - Master
Partner - Master

Try

Table1:
LOAD ID as LookUpID
...
FROM abc;

Concatenate

Table2:
LOAD ID
...
FROM xyz;

NoConcatenate
Final_Table:
LOAD * Resident
Where not Exists(IDToCheck,ID);

DROP Table Table1;

DROP Field LookUpID;

CK_WAKE
Creator
Creator
Author

Thanks for the help it worked.