Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Exclude duplicate records when joining tables

I have two tables with and ID and a value column.  Table1 and Table2

Need to concatentate these tables into one BUT if any IDs exist in Table2 that already exist in Table1, exclude from concatenating.

This is needed because data in Table1 is clean so records are correct.

Table2 has new records which I want but also ones with the same ID as Table1.  The Value column in this table may be incorrect for the IDN so I do not want to load this record.

How can I do this?

2 Replies
Anonymous
Not applicable
Author

Use condition exists():

Table1:

LOAD

ID

...

CONCATENATE (Table1) LOAD DISTINCT

...

RESIDENT Table2

where not exists(ID)

Not applicable
Author

Thanks for the info.  I could not use CONCATENATE because I attempted to drop the secondary table later to clear synthetic keys and the records from this table disappeared, even in the concatenated table.

I used ADD LOAD instead and it appears to be working the way I need it to.

Thanks for the help.