Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

indirection - use of for each?

I have a qvd file containing 999 records (customer number and name), i wish to create 999 unique files

containing a directional label (customer name), I am struggling ... any ideas?

2 Replies
swuehl
MVP
MVP

Maybe something like

List:

LOAD DISTINCT CustomerName as CustomerNameList

FROM QVDFile.qvd (qvd);

FOR EACH name IN FIELDVALUELIST('CustomerNameList')

SingleName:

LOAD '$(name)' as CustomerName

AUTOGENERATE 1;

Extract:

LOAD * FROM QVDFile.qvd (qvd)

WHERE EXISTS(CustomerName);

STORE Extract INTO [Customer_$(name).qvd] (qvd);

DROP TABLE Extract, SingleName;

NEXT name

DROP TABLE List;

Not applicable
Author