Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I have a requirement where I need to fetch multiple csv's from a path which is eg:- C:Data\Qlik\PlantName\InnerFolder\Week\'.csv'
I need to create a loop which will start from C:Data\Qlik
2. It will open the subfolder
3. Once its inside the subfolder it will search for an innerfolder and search for a folder name WEEK and load all the files from that folder.
4. If Week is not present in the innerfolder the loop will search for the file in the next subfolder and so on. (bcz there are multiple Plantname folders in the Main Qlik folder).
I have tried using for each but it doesn't work on three levels, can anyone suggest a solution please.
Hi, it may be something like:
for each PlantDir in dirlist ('C:\Data\Qlik\*')
for Each InnerFolder in dirlist (PlantDir)
for each WeekFolder in dirlist (InnerFolder)
IF Upper(Subfield('$(WeekFolder)','\',-1))='WEEK' THEN
LOAD
*
From [$(WeekFolder)\*.csv]
(txt, utf8, embedded labels, delimiter is ',', msq)
;
ENDIF
next
next
next
Hi, it may be something like:
for each PlantDir in dirlist ('C:\Data\Qlik\*')
for Each InnerFolder in dirlist (PlantDir)
for each WeekFolder in dirlist (InnerFolder)
IF Upper(Subfield('$(WeekFolder)','\',-1))='WEEK' THEN
LOAD
*
From [$(WeekFolder)\*.csv]
(txt, utf8, embedded labels, delimiter is ',', msq)
;
ENDIF
next
next
next
Thanks for the response