Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Techies,
How to load multiple csv files in single load statement in Qlikview.
Problem is ::::
I have a some files in one location.. my point of view i want to load all files and generate qvd data file for each source file.
It should be done dynamically..
In SSIS, it is possible, Is there any possibility using Foreach loop and variables.
Thanks
Chandra Mohan
You could use a script like this or see the examples in help under "for ... next // for each ... next":
x:
Load *, filename() as FileName From Path\Prefix*.csv (txt, codepage is 1252, embedded labels, delimiter is '\t', no quotes)
let vFileCount = fieldvaluecount(FileName);
for i = 0 to $(vFileCount) - 1
let vFileName = peek('FileName', $(i), 'x');
temp:
noconcatenate Load * Resident x Where FileName = '$( vFileName)';
store temp into '$( vFileName)'.qvd (qvd);
drop table temp;
next
Which way will best suited is depend from your folder/filename-structure, amount of data ...
- Marcus
Hi Marcus,
The Debugger skipping the Execution and throwing an error at below code line.
Set vPath='C:\Users\chandra.mohanc\Desktop\QlikView Training\Sources\';
X:
Load *,
filename() as FileName
From $(vPath)*.csv
(txt, codepage is 1252, embedded labels, delimiter is '\t', no quotes);
Try this and/or check the path:
From [$(vPath)*.csv] ...