Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ROBERTAR
Contributor
Contributor

Issue on Multiple XML loading

Hi, I’m new to Qlik Sense.

I’m trying to load different XML files to compare different versions of a product.

The XML file is composed by different tables but only 3 are the ones I’m Interested In, thus I used the wizard to load only those.

Parameters_list:

LOAD

   parameter,

   parpath,

   parclass,

   "min",

   "max",

     %Key_PARAMETER // this is automatically created by the script loader

   description AS Parameter_description

FROM [lib://mapping/file1.xml]

(XmlSimple, table is [MAPPINGFILE/CURRENTDIFF/DIFF/ADDED/PARAMETER]);

 

value:

LOAD Distinct

   parvalue,

   label AS Value_Description,

   %Key_PARAMETER // this is automatically created by the script loader

FROM [lib://mapping/file1.xml]

(XmlSimple, table is [MAPPINGFILE/CURRENTDIFF/DIFF/ADDED/PARAMETER/ENTRY]);

 

//The revision table has 1 value only for both product and version and no key to the other table.

Revision:

LOAD

   product,

   version,

FROM [lib://mapping/file1.xml]

(XmlSimple, table is MAPPINGFILE);

When I try to load only one file I’m able to get 1 table with the following (product and version repeated for each par and par value)

Es.file1

    parameter   parpath   parclass   "min"   "max"Parameter_descriptionparvalueValue_Descriptionproductversion
P1PATH1IN023PARAM 1  Prod1Ver1
P2PATH2IN  PARAM 2afirstProd1Ver1
P2PATH2IN  PARAM 2bsecondProd1Ver1
P2PATH2IN  PARAM 2cthridProd1Ver1

 

Es.file2

    parameter   parpath   parclass   "min"   "max"Parameter_descriptionparvalueValue_Descriptionproductversion
P1PATH4IN023PARAM 1  Prod1Ver2
P2PATH2IN  PARAM 2afirstProd1Ver2
P2PATH2IN  PARAM 2cthridProd1Ver2
P3PATH2OT  PARAM 37ASYSProd1Ver2

 

When I instead try to change the path to get all the two files loaded àFROM [lib://mapping/*.xml] I get a table showing for each parameter and values for any version (it creates variants that are not contained in the single files like this:

    parameter   parpath   parclass   "min"   "max"Parameter_descriptionparvalueValue_Descriptionproductversion
P1PATH1IN023PARAM 1  Prod1Ver1
P1PATH1IN023PARAM 1  Prod1Ver2
P2PATH2IN  PARAM 2afirstProd1Ver1
P2PATH2IN  PARAM 2bsecondProd1Ver1
P2PATH2IN  PARAM 2cthridProd1Ver1
P2PATH2IN  PARAM 2afirstProd1Ver2
P2PATH2IN  PARAM 2bsecondProd1Ver2
P2PATH2IN  PARAM 2cthridProd1Ver2
P3PATH2OT  PARAM 37ASYSProd1Ver1
P3PATH2OT  PARAM 37ASYSProd1Ver2

 

 

Anyone can help?

 

Thank you.

 

Labels (1)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You need to generate unique keys per file.  Change your keyfield to:

  FileBaseName() & %Key_PARAMETER as Key

See https://community.qlik.com/t5/QlikView-App-Development/XML-Keys/m-p/142207#M21742

for an explanation.

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

 

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You need to generate unique keys per file.  Change your keyfield to:

  FileBaseName() & %Key_PARAMETER as Key

See https://community.qlik.com/t5/QlikView-App-Development/XML-Keys/m-p/142207#M21742

for an explanation.

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

 

ROBERTAR
Contributor
Contributor
Author

Thank you Rob, It works!