Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
harsha087
Contributor III
Contributor III

not exists records

Hi All,

Below are the two tables 

T1:

Dates, Cust

1/2/2021,A

2/3/2021,C

T2:

Date, Custs

1/2/2021,A

2/2/2021, A

3/2/2021, A

2/3/2021,A

1/2/2021,B

2/2/2021, B

3/2/2021, B

2/3/2021,B

1/2/2021,C

2/2/2021, C

3/2/2021, C

2/3/2021,C

 

OUTPUT 

I need all the records which are not part of T1: 

Date, Cust

2/2/2021, A

3/2/2021, A

2/3/2021,A

1/2/2021,B

2/2/2021, B

3/2/2021, B

2/3/2021,B

1/2/2021,C

2/2/2021, C

3/2/2021, C

please help 

 

 

Labels (2)
7 Replies
ManuelRühl
Partner - Specialist
Partner - Specialist

Hi,

Maybe by using a mapping table:

Tmap:

mapping load
Dates&'|'&Cust as Key,
1 as Map
resident T1;

OUTPUT:

Load * resident T2 where applymap('TMap',Dates&'|'&Cust,0)<>1;

 

Best Regards

Manuel

 

Manuel Rühl
www.mamaconsulting.de
harsha087
Contributor III
Contributor III
Author

i m facing error 

The following error occurred:
ApplyMap error: map_id not found
 
The error occurred here:
t2: load Dates as Date, Custs Resident t1 where applymap('TMap',Date&'|'&Cust,0)<>1
MayilVahanan

Hi

Try like below

Load Dates&'|'&Cust as Key from Table1;

Load * from Table2 where not exists(Key, Dates&'|'&Cust);

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
harsha087
Contributor III
Contributor III
Author

i m getting below error 

Unexpected token: 'Key', expected one of: 'kml', 'biff', 'dif', 'fix', 'html', 'json', 'ooxml', ...

MayilVahanan

HI

Am not user, how you are loading the data in Qliksense.

Here, Table1 & Table 2 indicates ur  source(either excel, csv, db tables) .

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
harsha087
Contributor III
Contributor III
Author

Hi ,

Table1 is from SQL query 

table 2 is from inline load 

 

ManuelRühl
Partner - Specialist
Partner - Specialist

If T2 is an inline table, try a preceeding load.

Load the Key from T1

Then following:

Load * where not exists(Key, Dates&'|'&Cust);
LOAD * INLINE [ .......

Manuel Rühl
www.mamaconsulting.de