Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ashish_2511
Creator
Creator

Compare keys from two tables

Dear Community -

Here's the problem I'm facing -

I've two tables, Tab1 and Tab2 like this -

   

Tab1Tab2
%Key1%Key2
AX
BY
CZ

Tab1 is loaded first, when loading Tab2 I've to make sure %Key2 doesn't match any of %Key1. In other words, I've to load all those rows from Tab2 which are not in Tab1

Please Note - %Key1 and %Key2 are composite keys formed out of same fields from both tables.

Any help would be appreciated.

Thanks in advance

-Sneh

1 Solution

Accepted Solutions
Anonymous
Not applicable

Tab2:

LOAD

...

where not exists(%KEY1,YourKey2CompositionExpression);

could be that you have to put the parameters into '...'

View solution in original post

2 Replies
Anonymous
Not applicable

Tab2:

LOAD

...

where not exists(%KEY1,YourKey2CompositionExpression);

could be that you have to put the parameters into '...'

el_aprendiz111
Specialist
Specialist

hi,

1 example

TABLE1:
LOAD * Inline
[
%Key,value
A,1
B,2
C,3
]
;

PRM:
LOAD Concat(chr(39) & [%Key] & chr(39),',') AS PARAM Resident TABLE1;
LET v_Param = Peek('PARAM');

TABLE2:
LOAD * Inline
[
%Key,value
X,11
Y,22
Z,33
A,1
]

Where not wildMatch([%Key], $(v_Param))
;

TRACE ...... $(v_Param);

DROP Table PRM;
EXIT Script;