Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pawwy1415
Creator III
Creator III

Dynamically delete old .qvd

Hi, 

Please can you help on below how dynamically delete .

Let's app refreshed start on Monday 2nd (refresh will happen everyday but we want to retain only weekly and latest qvds )..

2nd, 3rd 4th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th 17th December

if app refresh On above dates 

In above case we need to retain only 2nd dec, 9th December , 16th December and 17th December Data (all other dates .qvd will be deleted )

 

When we have more data

18th 19th 20th 21st 22nd 23rd

 

Then it will show 2nd, 9th , 16th and 23rd December

Then if we have more date 24th 25th Then 2nd, 9th, 16th, 23rd, 25th 

In summary, latest Monday and latest date will be retained ) 

Please can someone help how we can handle this.

Labels (2)
1 Reply
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hi Pawwy,

 

You seem to touch base with two problems: 

1) How to execute a file delete statement from QlikSense

2) How to write the logic where at the end of your reload you identify the exact files you need to remove.

Here are some hints for you:

1) Qlik alone isn’t the proper tool for the purpose. Best practice is to write a .bat file and either start it from the QMC or have an “EXECUTE” statement in your QS script.

2) You can create your qvd’s like this:

STORE MyFile INTO MyFile_$(Date(Today())).qvd;

Or you can look into the FileTime() function.

 

I hope that helps!

Kind regards,

S.T.