Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
shumailh
Creator III
Creator III

How to put values of xml files in a variable

While scripting how can we put the value of our configuration xml file into variable,

Below is the code for your reference,


Directory;
// Start of [configuration.xml] LOAD statements
Configuration:
LOAD mn, PrePath FROM configuration.xml (XmlSimple, Table is [Configuration]);
// End of [configuration.xml] LOAD statements

let mn = ''; // want to put value of field mn in this variable
let prepath = 'D:\QlikView'; // want to put value of field prepath in this variable

let
CurrentFileName= 'ABCCHB' & right('00' &'$(CurrentDay)', 2) & '.dat' ;
let path= '$(prepath)' & '\Input' & '$(mn)' & '\CC\Conv' ;
let Outputpath= '$(prepath)' & '\Output' & '$(mn)' & '\CC\QVDs' ;



2 Replies
Not applicable

Hi Shumail,

Just do

let nm_field=peek('nm');

after loading the configuration.xml file.

The nm_field variable will store the latest value of nm (i supose you only have one value for nm)

Regards,

Joao



shumailh
Creator III
Creator III
Author

Hi Gordon,

Thanks for the function, Smile. but i have tried it in a different way as below,


$(include=Configuration.txt);

let path = '$(prepath)' & '\Input\' & '$(mn)' & '\Cards\Conventional\' ;
let Outputpath= '$(prepath)' & '\Output\' & '$(mn)' & '\Cards\QVDs\' ;


Regards
Shumail Hussain