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

help

Table A  -- Has mix of 3 & 6 digit zip codes

codeCity
ABC123Name1
ABD321Name2
ABEName3
ABCName4
ABDName5

Table B   -- has all 6 digit

CodeCity
ABC123Name1
ABD323Name7
ABE456Name3
ABC784Name4
ABD223Name5

Need Solution:

I need to do inner join between A & B where first all 6 digit are matched once match are found you filter them from second inner join where match will be performed on first 3 digit code. final results will be combination of both matches.

1 Solution

Accepted Solutions
pamaxeed
Partner - Creator III
Partner - Creator III

Sry here you are .

View solution in original post

11 Replies
pamaxeed
Partner - Creator III
Partner - Creator III

So in this example the output is ABC123 ....after the two inn er joins....

userid128223
Creator
Creator
Author

No. Because at 6 digit that will be the match, but another inner join match needs to be perfromed excluding the match. now at first 3 digit level.

userid128223
Creator
Creator
Author

Results

codeCity
ABC123Name1
ABEName3
ABCName4
ABDName5
pamaxeed
Partner - Creator III
Partner - Creator III

See the sample attached.

It should work, the output is the one u indicated.

Cheers,

Patric

userid128223
Creator
Creator
Author

Thanks Patric, i don't see any code in the script.

pamaxeed
Partner - Creator III
Partner - Creator III

Sry here you are .

userid128223
Creator
Creator
Author

can you please explain the code. thx

pamaxeed
Partner - Creator III
Partner - Creator III

It is not complicated:

  1. First inner join on code and city
  2. Second inner join on the first 3 characters of code and city excluding the codes i have got as output from the first inner join, see the WHERE NOT EXISTS part
  3. After that i concatenate the 2 output tables in one result table, and drop the two other tables.

Hope it helped u. Plz mark the answer as correct if it covered ur requirements

userid128223
Creator
Creator
Author

Thx.

What does 2 parameters do in Where Not Exist:

Where Not Exists(RefCode, Code);