Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I have collected the filenames (with complete path) of multiple csv files in a table. Is it possible to use the filename/filepathes of this table to load the files one after the other or choose a specific subset of the files in the table based on e.g. the filedate?
Best regards
Michael
Hi Michael
PATHs:
load
Distinct filepath( ) as X ,FileName() as Y from
C:\UserFiles\*.csv;
regards
Harsha
Hi Harsha,
that not exactly what I was thinking of. The table contains the following information (e.g.) Z:\20130701\example1.csv, Z:\20130701\example2.csv, Z:\20130701\example3.csv. in a field called FilenamePath. I would like to use this information to load the mentioned CSV files. So the script should look something like that:
Data:
Load
*
From Z:\20130701\example3.csv
but the information for the FROM statement which csv file to load should come from the existing table with the filename/filepath.
Best regards
Michael
Hi Michael
Please check the attached qlikview file
for i=1 to NoOfRows('PATHs')
LET TableName =FieldValue('filename',$(i));
Let Filepath=FieldValue('filepath',$(i));
let ZTableName=Left('$(TableName)',(len('$(TableName)')-4));
[$(ZTableName)]:
NoConcatenate
load
* from
$(Filepath)
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);next
regards
Harsha
You can do something like below :-
Test:
LOAD A
FROM
Book1.xlsx
(ooxml, no labels, table is Sheet1);
let var2=NoOfRows('Test');
let var3=0;
qualify *;
DO
Let var1=peek('A',$(var3),'Test');
trace<<var3;
LOAD *
FROM
$(var1)
(ooxml, no labels, table is Sheet1);
Let var3 = $(var3)+1;
Loop while $(var3)<=var2-1;