Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
viveksingh
Creator III
Creator III

Check QVD exists with date or not

Hi All,

I have QVD that splitted into multiple based on the dates.  SO the QVD names are  as follows

QVD_NAME_20191220

QVD_NAME_20191221

 

I want to check whether the QVD is already exists for a Date range, 

Let Say I want to check from 20190101 to 20191231. FOr these date range I should check the QVD is exitst or not. 

1 Solution

Accepted Solutions
Kushal_Chawda

see if this helps

vQVDPath = 'lib://Download/';

vMinDate = Floor(MakeDate(2018,1,1));

vMaxDate = Floor(Today());

QVDNames:
Load * Inline [
Temp ];

for i= vMinDate to vMaxDate

Let vDate = Date($(i),'YYYYMMDD');

Concatenate(QVDNames)
Load if(FileSize('$(vQVDPath)QVD_NAME_$(vDate).qvd'),'QVD Exist','QVD Not Exist') as Status,
     'QVD_NAME_$(vDate).qvd' as FileName
AutoGenerate 1;
     
Next

let i=i+1;

 

Note: Please change your variable according to requirement.

View solution in original post

3 Replies
tresesco
MVP
MVP

You can use for loop to run around all file values and use file functions like filesize() to check if it returns zero (fiel not exists) or  not. 

Brett_Bleess
Former Employee
Former Employee

Here is a Design Blog post that may be useful related to Amit's post:

https://community.qlik.com/t5/Qlik-Design-Blog/Loops-in-the-Script/ba-p/1473543

Here is the base Design Blog URL in case you wish to search for other posts on your own in that area:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Kushal_Chawda

see if this helps

vQVDPath = 'lib://Download/';

vMinDate = Floor(MakeDate(2018,1,1));

vMaxDate = Floor(Today());

QVDNames:
Load * Inline [
Temp ];

for i= vMinDate to vMaxDate

Let vDate = Date($(i),'YYYYMMDD');

Concatenate(QVDNames)
Load if(FileSize('$(vQVDPath)QVD_NAME_$(vDate).qvd'),'QVD Exist','QVD Not Exist') as Status,
     'QVD_NAME_$(vDate).qvd' as FileName
AutoGenerate 1;
     
Next

let i=i+1;

 

Note: Please change your variable according to requirement.