Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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.
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.
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
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.