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 the old date file with new date file

d Hi,

I have some csv files which are to be converted to qvds and store them with the Today's date in the file name. I did like this....................,

but the problem is each day I reload my script, everyday files with new date are stacking. Which I don't want. How Can I replace the old date files with new date files.

//My Script...

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 with new date like this

QVDToday.JPG

How can I replace the previous days QVD with the current day? Can some one plz help me

2 Replies
girirajsinh
Creator III
Creator III

HI

In your script first DELETE the existing qvd files by executing batch command from the scipt like below

EXECUTE cmd.exe /C "C:\Users\QlikviewExtreme\TEST.bat"

Your TEST.bat would contain a simple a batch command to remove *.qvd files in particular folder.

Also remember to make changes here

vinieme12
Champion III
Champion III

If you are not going to use the old files just over write them

Remove the date part of the filename and the QVD will overwrite the everyday

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.