Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replacing old Qvd name with new one

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

QVDToday.JPG

How can I replace the previous days QVD with the current day?

2 Replies
danielact
Partner - Creator III
Partner - Creator III

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".

Not applicable
Author

Thankyou Fleisher, but no luck

I am getting the same result.