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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Store multiple text files, split on a field

Good morning,

I am trying to use the store statement to dump a table after a script, but have it product multiple text files based on a field.

For example:

Output:

Load

CustomerNumber,

SalesAmt,

COGS,

SalesPerson,

City,

State

Resident Temp1;

Store Output into [\David\documents\text1.txt] (txt);

How can i get this script to make an individual text file for each Salesperson?

-David

Labels (1)
1 Reply
Anonymous
Not applicable
Author

hi david,

this should work:

Salespersontable:

load distinct

SalesPerson

Resident Temp1;

for i = 0 to noofrows('Salespersontable')

let vSP = peek ('SalesPerson', $(i), 'Salespersontable');

   

Output:

Load

CustomerNumber,

SalesAmt,

COGS,

SalesPerson,

City,

State

Resident Temp1 where match(SalesPerson, '$(vSP)');

Store Output into [\David\documents\text$(vSP).txt] (txt);

drop table Output;

next

Regards,

Stefan