Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
NenadV
Creator II
Creator II

Why this simple exists() function does not work as described in Help?

//Exists() determines whether a specific field value has already been loaded into the field in the data load script.
 
SpecsID:
load 'E2_' & ltrim(rtrim(PSpecID)) as KeySpecID, SpecName as BlaBla
from [..Specs.xlsx] (ooxml, embedded labels, table is Sheet1);
 
left join (SpecsID) load
CO_ID &'_'& PocketSpecID as KeySpecID,
SKU as ItemSold,
Year as Year,
FPeriod,
CustomerName as Customer,
sum(Qty) as QtySold
from ..\Sales.qvd (qvd)
where exists(KeySpecID)
group by CO_ID, PocketSpecID, Year, FPeriod, CustomerName, SKU;
 
Labels (2)
1 Solution

Accepted Solutions
anat
Master
Master

you will get only the matched records in table1 as you are using left join ,no need to use Exists explicitly...

you may try below if still you want to use exists

exists(KeySpecID,CO_ID &'_'& PocketSpecID)

View solution in original post

2 Replies
anat
Master
Master

you will get only the matched records in table1 as you are using left join ,no need to use Exists explicitly...

you may try below if still you want to use exists

exists(KeySpecID,CO_ID &'_'& PocketSpecID)

NenadV
Creator II
Creator II
Author

Thanks Anat, I decided to use Exists() to get an optimized load from the qvd file. Isn't that the main reason to use exists()?.

Otherwise, I've used a structure as you proposed, and that works ok.