Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Christian_Lauritzen
Partner - Creator II
Partner - Creator II

How to select values in Table A that are not in Table B in script?

How do I do this in Qlikview?

Example:

Table A_

ItemNo

x1

x2

x3

x4

Table B

ItemNo

x1

x3

x4

How do I write a query (using Resident as both tables are already read) in the script that results in:

ItemNo

x3

as x3 is the only value that only exists in Table A

Email: christian.lauritzen@b3.se
1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like this, adding to your script with existing tables:

TMP:

LOAD ItemNo as ExcludeItemNo Resident TableB;

LOAD ItemNo as OnlyInTableAItemNo Resident TableA where not exists(ExcludeItemNo, ItemNo);

drop table TMP;

View solution in original post

3 Replies
sbaldwin
Partner - Creator III
Partner - Creator III

Hi, first you would need to load Itemno and itemno as itemnocheck in your table B load, then you can  load using where not exists ie:

load

itemno 

resident table a_ where not exists(itemnocheck);

thanks

steve

swuehl
MVP
MVP

Maybe like this, adding to your script with existing tables:

TMP:

LOAD ItemNo as ExcludeItemNo Resident TableB;

LOAD ItemNo as OnlyInTableAItemNo Resident TableA where not exists(ExcludeItemNo, ItemNo);

drop table TMP;

Christian_Lauritzen
Partner - Creator II
Partner - Creator II
Author

Many thanks!

Email: christian.lauritzen@b3.se