Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
nihhalmca
Specialist II
Specialist II

Exists()

Hi All,

1. QVD has Country field.

2. Country field has values respectively USA, INDIA, JAPAN.

3. I want to extract only USA data by optimized way.

I mean using of where exists(). (Not to use where country = 'USA').

Sample Code:

Country:

Load

  Country   -- it has all countries

From Country.Qvd;

USA:

Load

Country --- expecting here only USA

From Country.qvd where exist ............

Regards,

Nihhal.

Labels (1)
26 Replies
swuehl
Champion III
Champion III

Not sure if I understand what you are trying to achieve.

Just note that using WHERE EXISTS() should keep your LOAD optimized (unless you unoptimize by some other actions, like calculated fields), and that EXISTS() will check for existence of field values loaded so far (i.e. in previous LOAD statements and in the current LOAD up to the current record).

You can use the EXISTS() function with two arguments as shown above to decouple your loaded field from the field you check the values in.

sasiparupudi1
Master III
Master III

Sample Code:

Country:

Load

  Country   -- it has all countries

From Country.Qvd;

USA:

Load

Country

From Country.qvd where Exists (Country,'USA');

Country:

Load

  Country   -- it has all countries

From Country.Qvd;

hth

Sasi

nihhalmca
Specialist II
Specialist II
Author

Hi Alvaro,

As per my knowledge we need associate table to perform where exists() that's why i used twice.

Moreover i tried your logic also but i did not solution.

Please find attached qvw file for reference.

Regards,

Nihhal.

nihhalmca
Specialist II
Specialist II
Author

Hi Sasi, tried not working

nihhalmca
Specialist II
Specialist II
Author

i got solution by 2 steps,

One is i created inline table with country - usa

Second i used where exists(country) in Qvd.

Thank you all.

Nihhal.

jagan
Partner - Champion III
Partner - Champion III

Hi Nihhal,

This is what swuehl‌ and I replied in our first post itself. Please check those.

Regards,

Jagan.

nihhalmca
Specialist II
Specialist II
Author

Yes Jagan, thanks for reporting this. I will do.