Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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.
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
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.
Hi Sasi, tried not working
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.
Hi Nihhal,
This is what swuehl and I replied in our first post itself. Please check those.
Regards,
Jagan.
Yes Jagan, thanks for reporting this. I will do.