Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am attempting to load a file which appears in a number of date folders but I keep getting a syntax error.
Imagine the directory like this:
20131404 > Registrations.csv
20131504 > Registrations.csv
So what I am trying to achieve is to loop through each date folder and load the Registrations.csv.
I am using From "Test\*\Registrations.csv" - is this the correct method to use?
Any help is much appreciated
Something like this maybe:
for each SubDirectory in dirlist( 'D\MyDate\*' )
Table1:
load * from $(SubDirectory)\Registrations.csv (txt, codepage is 1252, embedded labels);
next SubDirectory
Hi Gysbert,
Thanks for the reply.
I tried this out however it doesn't seem to recognise the * in the directory string.
I have put 'C:\Users\eaamk\Desktop\Qlikview Report\*' as the dirlist and I receive an error saying file not found.
When I reload the report the error message identifies the location as 'C:\Users\eaamk\Desktop\Qlikview Report\Registrations_Agent_Extract.csv'.
Try this.
SUB DoDir (Root)
Load * from Registrations_Agent_Extract.csv ;
NEXT Ext
FOR Each Dir in dirlist (Root&'\*' )
call DoDir (Dir)
NEXT Dir
ENDSUB
CALL DoDir ('C:')
Regards,
Kaushik Solanki
Hi Kaushik,
I have tried using this sub-routine a few ways but the structure below seems to only return one error.
The error shows that qlikview doesn't recognise the *.
set Root="C:\Users\eaamk\Desktop\Qlikview Report\*\";
SUB DoDir (Root)
FOR Each Dir in dirlist (Root)
Load * from Registrations_Agent_Extract.csv ;
call DoDir (Dir)
NEXT Dir
ENDSUB
CALL DoDir ('C:\Users\eaamk\Desktop\Qlikview Report').
I've tried adding in the name of the sub-directory instead of the * and this runs ok but nothing is loaded from the CSV.
Hi,
try this:
SUB DoDir (Root)
For each File in filelist (Root'\*Registrations*.csv')
Load
*
FROM
$(File) ;
NEXT File
For each Dir in dirlist (Root&'\*')
CALL DoDir (Dir)
NEXT Dir
ENDSUB
CALL DoDir ('C:\Users\eaamk\Desktop\Qlikview Report')
Hi,
try this:
SUB DoDir (Root)
For each File in filelist (Root'\*Registrations*.csv')
Load
*
FROM
$(File) ;
NEXT File
For each Dir in dirlist (Root&'\*')
CALL DoDir (Dir)
NEXT Dir
ENDSUB
CALL DoDir ('C:\Users\eaamk\Desktop\Qlikview Report')