Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
CK_WAKE
Contributor III
Contributor III

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
Contributor III
Contributor III
Author

Thanks for the help it worked.