Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
s2016
Contributor III
Contributor III

Load N Weekly QVD Files in an app

Hi,

I'm looking to load N number of Weekly QVDs from a directory. Files are named as Data_YYYYMMDD.qvd with a new file created on each Monday of the week.

e.g.) Data_20181126.qvd, Data_20181119.qvd, Data_20181112.qvd, Data_20181105.qvd,  etc. 

I need to load the latest 66 weeks in my app.

 

Any suggestions?

1 Solution

Accepted Solutions
prieper
Master II
Master II

aircode might be:
FOR EACH vL.File IN FILELIST ('MyDirectory\Data_*.QVD')
IF(DATE#(LEFT(RIGHT([vL.File], 12), 8), 'YYYYMMDD') >= TODAY() - (66*7) THEN
Data: LOAD * FROM [$(vL.File)] ....;
END IF
NEXT vL.File

View solution in original post

1 Reply
prieper
Master II
Master II

aircode might be:
FOR EACH vL.File IN FILELIST ('MyDirectory\Data_*.QVD')
IF(DATE#(LEFT(RIGHT([vL.File], 12), 8), 'YYYYMMDD') >= TODAY() - (66*7) THEN
Data: LOAD * FROM [$(vL.File)] ....;
END IF
NEXT vL.File