Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
lmonincx
Creator II
Creator II

XML Keys

Hi,

This is my first time working with xml files,I am loading several xml files in my application, they are being concatenated but there is no key which links the different tables together.QV generates a %key but that is always a 0 for eachfile, how can i create/get a key to link the files?

any help is appreciated.

8 Replies
Not applicable

When you are loading data into an application, fields with like names are joined.

If your fields are do not have the same name, you can use an alias to make the names match.

SELECT Field1, Field1 AS QKey

Sometimes it helps to load a field with its given name and then load it again with the alias to make it a key.

Once both fields have the same name, QlikView will link them. You can use the Table Viewer (Ctrl+T) to see a visual respresentation of your data.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

When loading multple xml files like *.xml, you have to create some file-based uniqueness for the key. Check out this post from the archives to see if it solves your problem.
http://community.qlik.com/forums/p/13883/54380.aspx#54380

-Rob

Not applicable

Resource not found when clicking thta URL. Would it be possible to correc the URL?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The link works for me but I understand it doesn't work for you. Here's the content at that link:

"The problem is with the generated %Key... field, which is a generated counter starting with 0 that links the child xml node with the parent node. The xml load process resets this counter to zero at the beginning of each file so child elements from the second file are incorrectly linked to parents from a previous file. The solution is to introduce some uniqueness into the key so you get linkage only within an individual file. Modify your %Key... statements as follows:
FileBaseName() & %Key_devices_DAEC5B79D00913EA as Key //key created by wizard
That will create unique keys and your data should link up correctly
. -Rob"
If that doesn't resolve your question, post some details of your specific problem here and I'll try to respond.
Tyler_Waterfall
Employee
Employee

Still helpful, 3 years later. Thanks Rob Wunderlich!

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Glad to know the archives are still useful!

-Rob

ingoniclas
Creator II
Creator II

Another 5 years this also saved my life. Awesome, Rob!

Arek92
Contributor III
Contributor III

13 years later and it still works like a charm. Thanks, Rob!