Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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_description | parvalue | Value_Description | product | version |
P1 | PATH1 | IN | 0 | 23 | PARAM 1 | Prod1 | Ver1 | ||
P2 | PATH2 | IN | PARAM 2 | a | first | Prod1 | Ver1 | ||
P2 | PATH2 | IN | PARAM 2 | b | second | Prod1 | Ver1 | ||
P2 | PATH2 | IN | PARAM 2 | c | thrid | Prod1 | Ver1 |
Es.file2
parameter | parpath | parclass | "min" | "max" | Parameter_description | parvalue | Value_Description | product | version |
P1 | PATH4 | IN | 0 | 23 | PARAM 1 | Prod1 | Ver2 | ||
P2 | PATH2 | IN | PARAM 2 | a | first | Prod1 | Ver2 | ||
P2 | PATH2 | IN | PARAM 2 | c | thrid | Prod1 | Ver2 | ||
P3 | PATH2 | OT | PARAM 3 | 7A | SYS | Prod1 | Ver2 |
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_description | parvalue | Value_Description | product | version |
P1 | PATH1 | IN | 0 | 23 | PARAM 1 | Prod1 | Ver1 | ||
P1 | PATH1 | IN | 0 | 23 | PARAM 1 | Prod1 | Ver2 | ||
P2 | PATH2 | IN | PARAM 2 | a | first | Prod1 | Ver1 | ||
P2 | PATH2 | IN | PARAM 2 | b | second | Prod1 | Ver1 | ||
P2 | PATH2 | IN | PARAM 2 | c | thrid | Prod1 | Ver1 | ||
P2 | PATH2 | IN | PARAM 2 | a | first | Prod1 | Ver2 | ||
P2 | PATH2 | IN | PARAM 2 | b | second | Prod1 | Ver2 | ||
P2 | PATH2 | IN | PARAM 2 | c | thrid | Prod1 | Ver2 | ||
P3 | PATH2 | OT | PARAM 3 | 7A | SYS | Prod1 | Ver1 | ||
P3 | PATH2 | OT | PARAM 3 | 7A | SYS | Prod1 | Ver2 |
Anyone can help?
Thank you.
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
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
Thank you Rob, It works!