Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.............
// 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);
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.
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
// 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);