Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

subrattiwari
New Contributor II

Use of 'Where Exists'

Hi all...

I want to understand how the combination of keywords 'where exists' & 'where not exists' works in Qlikview.

Suppose I have 2 tables and I want to load the records by checking on some field by using "where exists".

How can this be done?

Can anybody please explain by providing a simple example?

Help is appreciated.

4 Replies
MVP & Luminary
MVP & Luminary

Re: Use of 'Where Exists'

Have a look at the Exists entry in the help file. It has some examples.

Or try reading some discussion by searching for this topic: http://community.qlik.com/search.jspa?q=where+exists


talk is cheap, supply exceeds demand
oknotsen
Honored Contributor III

Re: Use of 'Where Exists'

Assuming theKey is your key field, use this code to only load from table2 the rows that are not yet loaded:

Load

theKey,

A,

B,

C

from table2

where not exist (theKey);

Assuming anotherKey needs to be matched against theKey and only load rows where there is no match, us something like this:

Load

anotherKey,

A,

B,

C

from table2

where not exist(theKey, anotherKey);

Both examples assume table1 with theKey are already loaded.

May you live in interesting times!
Highlighted
subrattiwari
New Contributor II

Re: Use of 'Where Exists'

Thanks Gysbert....that link is really useful !

subrattiwari
New Contributor II

Re: Use of 'Where Exists'

Nicely explained with a simple example...thanks for the help !!