Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to loop through subdirectories and load the file names ONLY for files with certain text in the file name, where that text is variable from month to month...for example April's files will have "201904" in the name, May's files will have "201905" in the file name. I have the looping working but cannot seem to figure out how to filter out unwanted filenames and dynamically select the files I do want using my variable $(vMEDate). Here is my code thus far; can someone offer suggestions on how to accomplish my goal? Thanks.
let vMERootDir = '\\MYFOLDER\MEReports\TEST\';
let vMEDate = Year(MonthStart(Today())-1) & Num(Month(MonthStart(Today())-1), '00'); //look for latest files only, ie 201904
sub DoDir (Root)
for each Ext in 'pdf'
for each File in filelist (Root & '\*.' & Ext)
ReportOutput_temp:
LOAD
FileBaseName() as PDFReportFileName
from $(File)
;
next File
next Ext
for each Dir in dirlist (Root & '\*' )
call DoDir (Dir)
next Dir
end sub
call DoDir ('$(vMERootDir)')
I think you can just modify your forfiles to include the variable:
for each File in filelist (Root & '\*$(vMEDate)*.' & Ext)
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
I think you can just modify your forfiles to include the variable:
for each File in filelist (Root & '\*$(vMEDate)*.' & Ext)
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
Thanks, I had tried that but I must have had my syntax wrong.