Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to find latest folder in Network folder and load files from that folder using qlikview load script. wondering how to automate process with changing dates manually.
For example
Network folder : "\\dev\"
Folders:
20160201 - folder 1
20160601 - folder 2
Files in folder 20160601 will be
20160601_abc1.xls
20160601_abc2.xlx
Load script is
load *
from "\\dev\20160601\20160601_*.*";
Thanks
Try this,
Set vBaseDirName = '\\Dev\*'; FOR Each vSubFolder in DirList(vBaseDirName) Folders: LOAD '$(vSubFolder)' as FolderPath, Date(Date#(Subfield('$(vSubFolder)' ,'\', -1),'YYYYMMDD'), 'YYYYMMDD') as YearMonth AutoGenerate 1; NEXT vSubFolder Latest: NoConcatenate Load FolderPath, YearMonth Resident Folders Order by YearMonth desc; Let vLatestFolder = Peek('FolderPath',0, 'Latest'); DROP Table Folders, Latest; LatestData: Load * from $(vLatestFolder)\20160601_*.*;