Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
for each vFile in FileList('C:\Qlik view software\Training\Dimension Tables\Dimension Tables\*.csv')
let vQVD = replace(vFile, '.csv', '.qvd');
let vToday = Date(Today(),'DD-MMM-YYYY');
let vQVDToday = replace(vFile, '.csv', '_$(vToday).qvd');
Data:
LOAD * FROM $(vFile);
STORE Data into $(vQVD);
STORE Data into $(vQVDToday);
NEXT vFile
My files are visible today like this
How can I replace the previous days QVD with the current day?
When it runs, use another variable and assign it the date at the end of the script:
Let vCurrRun=$(vToday)
That way, you store the date of your run and it doesn't get overwritten until the script finishes loading.
Add another line to your script (earlier in the load):
let vQVDPrior = replace(vFile, '.csv', '_$(vCurrRun).qvd');
You can then use a batch statement to delete the old QVD files using that variable:
EXECUTE
cmd.exe /C del $(vQVDPrior);
There are some setting that need to be set properly for a batch statement to work - in the script editor, on the bottom, go to the Settings tab, and check "Can execute external programs".
Thankyou Fleisher, but no luck
I am getting the same result.