Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm using the following script to convert a load of CSV files to QVD
for each file in FileList('$(vFolder)datafile*.csv')
Daily:
LOAD *
FROM $(file)
(txt, utf8, embedded labels, delimiter is '|', msq);
Let vPathFileDate = Date(Date#(left(subfield(subfield('$(file)','\', -1), '_', -1), 8), 'YYYYMMDD'), 'YYYY_MM_DD');
STORE Daily INTO ..\..\Daily\Daily_$(vPathFileDate).QVD;
DROP TABLE Daily;
Next file;
It is running fine until it gets tot the end and I get a
Script line error:
Next File
Can anyone help....?
Thanks,
Phil
Try removing the semicolon after next file
Do not think that the semicolon makes the difference.
Would rather check the spelling and/or rename the variable to vFile or the like
Try
Let vPathFileDate = Date#(Date#(left(subfield(subfield('$(file)','\', -1), '_', -1), 8), 'YYYYMMDD'), 'YYYY_MM_DD');
It runs just fine for me and I made no changes. You may have different values in your variables and/or different folder permissions.
IMHO this is an ideal case to use the QlikView Script Debugger. After each statement, it lets you check all variables vlaues before you use them (e.g. vFolder, file, and especially vPathFileDate)