Qlik Community

QlikView Documents

Documents for QlikView related information.

How to load QVDs dynamically based on Date and its availability

Arjunarao
Honored Contributor II

How to load QVDs dynamically based on Date and its availability

In general , we will load the data in QVDs with daily basis or monthly basis with suffix.

Sometimes we need to pick latest QVDs and load into the dashboard.

I have QVDs like QVD_2017_01,QVD_2017_02,QVD_2017_03,QVD_2017_04,QVD_2017_04 and so on…

I want to load latest QVDs like last 3 months if it exists.

How to achieve this requirement?

FOR i = 0 to vMaxMonthNumber

let Date_Suffix = date(floor(monthstart(today(), -vMaxMonthNumber+i)), 'YYYY_MM');

LET vFileNotAvailable=isnull(QvdCreateTime('$(vQVDPath)\QVD Folder\Table1_$(Date_Suffix).qvd')); // if qvd exists then 0 else -1

IF not $(vFileNotAvailable) then

Table1:

load *

FROM $(vQVDPath)\QVD Folder\Table1_$(Date_Suffix).qvd (qvd);

end if

LET vFileNotAvailable=isnull(QvdCreateTime('$(vQVDPath)\QVD Folder\Table2_$(Date_Suffix).qvd')); // if qvd exists then 0 else -1

IF not $(vFileNotAvailable) then

Table2:

load *

FROM $(vQVDPath)\QVD Folder\Table2_$(Date_Suffix).qvd (qvd);

end if;

NEXT i;

Version history
Revision #:
1 of 1
Last update:
‎03-06-2018 04:44 AM
Updated by: