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: 
panipat1990
Creator II
Creator II

Help

Hi,

    I am New In qlikview... I want to Full knowledge of Exists Function or Where Exists Not Exists..........Please Help Me......With Example QVW.............

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

// Where Exists

// Consider that you have Sales Table and Customer Table.

// You want to load only those Customer Data for which Sales Exists.

Sales:

Load *, Customer as TempCustomer Inline

[

  Customer, Sales

  A, 100

  B, 120

];

Customer:

Load * Inline

[

  Customer, Country

  A, UK

  B, Germany

  C, India

] Where Exists (TempCustomer, Customer);

Drop Field TempCustomer;

// Where Not Exists

// Consider you have Employee information stored in OldRecords Table.

// Now you received NewRecords table and want to update the table.

// Here you have to load NewRecordes and only those Employee

// from OldRecords table which are not present in NewRecords table.

// Here you can use Where Not Exists.

NewRecords:

Load * Inline

[

  Employee, Address

  A, 4444 UK

  B, 9999 Germany

  D, 1111 Poland

];

OldRecords:

Load * Inline

[

  Employee, Address

  A, 1234 UK

  B, 3456 Geramy

  C, 4534 France

] Where Not Exists (Employee);

View solution in original post

3 Replies
qlikmsg4u
Specialist
Specialist

Hi Gourav,

Please read discussion

Understanding EXISTS() function - Qlikview vs SQL/RDBMS

And in the attached app try to load different scenarios you will get some idea.

alexandros17
Partner - Champion III
Partner - Champion III

At first take a look at help, then I can add a simple example:

Suppose you have loaded

Select A, B, C from myTable;

then you need to load another table but only the records where A yet exists (in the previous select) so you can write

Load A1, B1, C1 resident Table2 where Exists(A, A1);

in this case only records from table2 having A1 in the records of myTable will be loaded

MK_QSL
MVP
MVP

// Where Exists

// Consider that you have Sales Table and Customer Table.

// You want to load only those Customer Data for which Sales Exists.

Sales:

Load *, Customer as TempCustomer Inline

[

  Customer, Sales

  A, 100

  B, 120

];

Customer:

Load * Inline

[

  Customer, Country

  A, UK

  B, Germany

  C, India

] Where Exists (TempCustomer, Customer);

Drop Field TempCustomer;

// Where Not Exists

// Consider you have Employee information stored in OldRecords Table.

// Now you received NewRecords table and want to update the table.

// Here you have to load NewRecordes and only those Employee

// from OldRecords table which are not present in NewRecords table.

// Here you can use Where Not Exists.

NewRecords:

Load * Inline

[

  Employee, Address

  A, 4444 UK

  B, 9999 Germany

  D, 1111 Poland

];

OldRecords:

Load * Inline

[

  Employee, Address

  A, 1234 UK

  B, 3456 Geramy

  C, 4534 France

] Where Not Exists (Employee);