Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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