Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I am new to qlikview. I have around 800 xml files wich i need to load for making the application.
they have same number of fields as well as field names are same.
only the data changes.
is there a easy way like looping.
or should i load each and every single file.
Regards
Tausif Khan
Hi,
Try:
NoConcatenate for separate QVDs:
// Root variable holds path with xml files
Set Root="C:\Qlikview\XmlFiles";
Set A = 0;
Set vTableName ="XmlData";
FOR each FILE in filelist (Root&'\*.xml')
let A=$(A)+1;
let vTableName = $(vTableName)+$(A);
// create table(s) according to your xml structure.
$(vTableName):
NoConcatenate
LOAD
ID,
Name,
Date,
FileName(FILE) as key
FROM $(FILE)(XmlSimple, Table is [table]);
STORE $(vTableName) INTO $(vTableName).QVD;
NEXT FILE
OR
Concatenate for Consolidate QVD for all files.
// Root variable holds path with xml files Regards Neetha
Set Root="C:\Qlikview\XmlFiles";
Set vTableName ="XmlData";
FOR each FILE in filelist (Root&'\*.xml')
let vTableName = $(vTableName);
// create table(s) according to your xml structure.
$(vTableName):
Concatenate
LOAD
ID,
Name,
Date,
FileName(FILE) as key
FROM $(FILE)(XmlSimple, Table is );
NEXT FILE
STORE $(vTableName) INTO $(vTableName).QVD;
You could try with
Load *,
FileBaseName() as FileName
From *.XML
...
Regards
Marco