Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
lmonincx
Contributor 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.

7 Replies
Not applicable

XML Keys

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.

MVP & Luminary
MVP & Luminary

XML Keys

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

XML Keys

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

Highlighted
MVP & Luminary
MVP & Luminary

XML Keys

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

Re: XML Keys

Still helpful, 3 years later. Thanks Rob Wunderlich!

MVP & Luminary
MVP & Luminary

Re: XML Keys

Glad to know the archives are still useful!

-Rob

ingoniclas
Contributor

Re: XML Keys

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