Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I need to load same structure csv files from 3 different folders locatted in on folder.
(3 stores of , each has its own sales csv files)
Also i need to gave the option to choose how many days of csv files i am uploading. (Each csv by its creation date)
Thank you
For each _folder in 'LM' ,'LN','LT'
For each _csv in filelist ('\\182.19.38.22\Data\BiFiles\$(_folder)\SalesDetail_*.csv')
If filetime('$(_csv)') > dayname(today() - 21) then
Load * from [$(_csv)] (txt);
End If
Next _csv
Next _folder
You can loop through files and folder using for each loops. And use filetime() to check the date of your file.
Try something like the sample I have typed below.
For each _folder in 'location/1', 'location/2', 'location/3'
For each _csv in filelist ('$(_folder) /*.csv')
If filetime('$(_csv)') > dayname(today() - 21) then
Load * from [$(_csv)] (txt);
End If
Next _csv
Next _folder
thank you for the replay.
im kind new to Qlik , can you be more spacific please?
the main folder is: '\\182.19.38.22\Data\BiFiles\'
the 3 folders located in this main folder are: LM,LN,LT
and the files in each: SalesDetail_*.csv
can you please write the full syntacs?
and if its possible i want the folders to be in a var so i don't need to specific every location sparely
For each _folder in 'LM' ,'LN','LT'
For each _csv in filelist ('\\182.19.38.22\Data\BiFiles\$(_folder)\SalesDetail_*.csv')
If filetime('$(_csv)') > dayname(today() - 21) then
Load * from [$(_csv)] (txt);
End If
Next _csv
Next _folder
Thank you very much!