Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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 - Creator II
Partner - Creator II

let vYear=Year(Today());

 

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