Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
nakuldev
Creator
Creator

Dyanamic load of excel files based on year from folder

Hi All,

I need to load excel files dynamically from the folder based on year. The name of excel file ends with date (daily basis) and the below image is for reference.

In the folder I have files for 2020 as well, however I need to restrict the files ending with 2020 while loading. As the current year is 2021, I need to load only files ending with 2021.

nakuldev_0-1626683162350.png

Thanks for the support in advance

Nakul

 

Labels (3)
3 Replies
ArinaRay
Contributor
Contributor

Hi, @nakuldev 

You can try

 

let folder = 'Your_path';

for each file in FileList('$(folder)/*.qvd')
let file_name = SubField('$(file)', '/', -1);

if index('$(file_name)', '2021') > 0 then

LOAD
from $(file)
(qvd);

End If;

next file;

menta
Partner
Partner

let vYear=Year(Today());

 

Load * from [lib:/yourlibrary/Daily*$(vYear)*];