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: 
RJW
Contributor III
Contributor III

Only load customers with certain flag?

Hi,

I have a large list of customers IDs within a separate QVD file (>10,000 customers). Each customer has their own flag that categorizes them. In a new Qlik file, I only want to load customers from one of the categories. How might begin to write this script? The data looks like below:

Customer ID Flag
0001 Northwest
0002 Southeast
0003 Northwest

 

So, for example, I only want to load Customer ID's from the Northwest region ONLY. 

Labels (1)
3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm unclear if the flag is in the main QVD file or a separate file?  

If the same QVD then:

LOAD * From yourqvd.qvd (qvd)
Where Flag = 'Northwest';

If the flag is in a separate QVD the:

FlagTemp:
LOAD CustomeID From Flag.qvd (qvd)
Where Flag = 'Northwest';

Main:
Load * From Main.qvd (qvd)
Where exists (CustomerId);

Drop Table FlagTemp;

-Rob

RJW
Contributor III
Contributor III
Author

Thanks! The flag is in a separate QVD file maintained by other users at my company. 

Would you be able to clarify the load statement in the Main table when you point to "Main. qvd"? Is that my file path or the separate QVD?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

That is the file path to your qvd with all the data.

-Rob