Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

christianlaurit
Not applicable

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

1 Solution

Accepted Solutions
swuehl
Not applicable

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

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;

3 Replies
sbaldwin
Not applicable

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

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
Not applicable

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

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;

christianlaurit
Not applicable

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

Many thanks!