2

I want to load two xml files. They are using the same xsd. Because of differences in file content, the QlikView xml wizard creates different table structure for load statements. By manual edits in the XML load statements I have managed to load both the xml files in same table structure, but the key generation now fails.

With key fields i mean "fields that start with %Key_ as in the code exerpt below:

Payload:
LOAD xmlns,
    [xmlns:xsi],
    [RecordSet/RecordSetDate] as RecordSetDate,
    [RecordSet/RecordSetType] as RecordSetType,
    %Key_Payload_B02A2AB5DB894C01    // Key for this table: Payload
FROM [\\path\VXI_CS_HourChat_20160405_131520.xml] (XmlSimple, Table is [Payload]);
// End of [VXI_CS_HourCall_20160405_131513.xml] LOAD statements

My questions are:

  • How does QlikView define "tables" in xml files?
  • What is the syntax/logic behind the key generation in xml loads?
  • Can you edit the key fields manually, or must they be generated by the wizard?
LudvigH
  • 3,662
  • 5
  • 31
  • 49

1 Answers1

0

Umm... Create two LOAD statements with the XML wizard and concatenate?

MyData:
LOAD (...) FROM someFile.xml (...);

Concatenate(MyData)
LOAD (...) FROM otherFile.xml (...);

Do not edit the key fields manually. You can rename them, though, like this: LOAD (...) %Key_Payload_B02A2AB5DB894C01 As KeyField. You should actually do this in order to concatenate the files so that the fields that are common to both files have the same name.

It seems that QlikView generates a table for each repeating element in the XML file.

Waldo
  • 423
  • 4
  • 5