Qlik Community

QlikView Documents

Documents for QlikView related information.

Load Multiple XML files and store in QVDs

neetha_p
Honored Contributor

Load Multiple XML files and store in QVDs

Script to Load Multiple XML files and store in QVDs

1.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

2.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;

Version history
Revision #:
1 of 1
Last update:
‎2015-01-24 08:41 AM
Updated by: