Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading multiple XML files.

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

2 Replies
Anonymous
Not applicable
Author

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 

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;

Regards

Neetha

MarcoWedel

You could try with

Load *,

         FileBaseName() as FileName

From *.XML

...

Regards

Marco