Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
deep2021
Creator III
Creator III

Keep latest 12 months QVD in the folder.

Hi All,

My QVD are in the below format,

QVDName_MM_DD_YYYY.qvd.

As per the need I need to keep the latest 12 months QVD.

For instance, if I have first qvd is Jan 2022 then I need to maintain QVd till Feb 2021.

Could you please assist me on this?

Can we write the QVd deletion logic in the QS load script?

Thanks

Thanks

Labels (3)
4 Replies
Chanty4u
MVP
MVP

try something below

     Where monthstart([YourMonthYear])  >= monthstart(addmonths(today(),-12))

or

FROM Source;

Where MonthYear  >= (Addmonths(Today(),-13));

 

or

Load *
from DataQVD.qvd(qvd)
where Date >= AddMonths(Monthend(today()),-13) and Date < Monthstart(today());

 

or

 

 

Vegar
MVP
MVP

Qlik Sense is not really the best tool for tidying among your files, there are no file delete functions built into Qlik Sense. If you need to delete older files you need to rely on some kind of execute script that does the deletion for you. If youbhave no other tool then consider creating a bat file that you schedule on the server.

An alternative work around if you only need 12 months then you could consider not storing the files to qvd files named with  both year and month in the FileName. If you only use Months (Jan, feb,...,dec) then you will just have 12 files that will be overwritten once  every 12 months.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Instead of deleting QVDs, you may want to just load the recent 12 months. See

https://qlikviewcookbook.com/2022/03/how-to-segment-qvd-files/

-Rob

deep2021
Creator III
Creator III
Author

Hi All,

Currently, there is a need of deletion logic. some QVds need to maintain for last 4 months and some for 12 and 15 months.

Our QVd's are in the below format.

QVDName_MM_DD_YYYY.qvd.

 

Could you please assist me how to create the bat file for the same?

Thanks