Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Tags (1)
1 Reply
s_kunte23
Contributor III

Re: Store multiple text files, split on a field

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

Community Browser