Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to search for a folder Name with a pattern

Hi ,

I have a folder that have many sub-folders with this names Month_Year , example : Mai_2014

I want to search through that folder and find the latest month/year available.

So the question is : How can i store this information (Mai 2014 for example) in a variable in the loading script.

Thank you

Example :

Folder

---- January_2014

---- February_2014

---- March_2014

So the result will put March_2014 in a variable.

Thank you

1 Reply
Not applicable
Author

You could use a directory load to get the file names as a field

So it would look something like this

FOR each Dir in dirlist ('Put the full file path for the folder containing the files you need loaded here')

Load Distinct

FileName() as FileName

FROM

$(Dir)\*

;

Then just split out the year and month and find the max value to set as a variable.