Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Thanks for the support in advance
Nakul
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;
let vYear=Year(Today());
Load * from [lib:/yourlibrary/Daily*$(vYear)*];