Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to store individual QVD based on Date, How can I write the script for that ?
Source:
XXX | Date |
---|---|
XX | 01/01/2018 |
XYX | 01/01/2018 |
XYYYX | 01/02/2018 |
X | 01/03/2018 |
XX | 01/03/2018 |
XXX | 01/03/2018 |
XYZ | 01/03/2018 |
ZZZ | 01/02/2018 |
YYYY | 01/02/2018 |
Result:
01/01/2018.qvd
01/02/2018.qvd
01/03/2018.qvd etc...
May be this
Table:
LOAD * INLINE [
XXX, Date
XX, 01/01/2018
XYX, 01/01/2018
XYYYX, 01/02/2018
X, 01/03/2018
XX, 01/03/2018
XXX, 01/03/2018
XYZ, 01/03/2018
ZZZ, 01/02/2018
YYYY, 01/02/2018
];
FOR i = 1 to FieldValueCount('Date')
LET vDate = FieldValue('Date', $(i));
LET vDateSave = Date(FieldValue('Date', $(i)), 'YYYYMMDD');
TempTable:
NoConcatenate
LOAD *
Resident Table
Where Date = '$(vDate)';
STORE TempTable into QVD_$(vDateSave).qvd (qvd);
DROP Table TempTable;
NEXT
Make a variable, store the date and use it in your QVD Name during creation.
May be this
Table:
LOAD * INLINE [
XXX, Date
XX, 01/01/2018
XYX, 01/01/2018
XYYYX, 01/02/2018
X, 01/03/2018
XX, 01/03/2018
XXX, 01/03/2018
XYZ, 01/03/2018
ZZZ, 01/02/2018
YYYY, 01/02/2018
];
FOR i = 1 to FieldValueCount('Date')
LET vDate = FieldValue('Date', $(i));
LET vDateSave = Date(FieldValue('Date', $(i)), 'YYYYMMDD');
TempTable:
NoConcatenate
LOAD *
Resident Table
Where Date = '$(vDate)';
STORE TempTable into QVD_$(vDateSave).qvd (qvd);
DROP Table TempTable;
NEXT