Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
grenwick
New Contributor III

Loading in Attribute Centric XML in QlikView Load Script

Hi,

Has anyone got a nice way of working with XML that contain attributes? The QV load wizard does not seem to work well with it.

Here is a sample of XML.

<list>

     <ProfileDefinition>

          <string name="ID">1</string>

          <string name="name">My QlikView Application for XML</string>

     </ProfileDefinition>

</list>

After loading, I would like to see

Table Name: ProfileDefinition

IDName
1My QlikView Application for XML


Thanks

1 Solution

Accepted Solutions
grenwick
New Contributor III

Loading in Attribute Centric XML in QlikView Load Script

Hi,

I got a solution.

Basically loading 1 attribute value at a time using Where and then joining the attributes based on a RowNo() key.

ProfileDefinition:

LOAD

    RowNo() as AutoKey,

    string%Table as ID

WHERE name = 'ID';

LOAD string%Table, name

FROM C:\Test.xml (XmlSimple, Table is [list/ProfileDefinition/string]);

Join

LOAD

    RowNo() as AutoKey,

    string%Table as Name

WHERE name = 'name';

LOAD string%Table, name

FROM C:\Test.xml (XmlSimple, Table is [list/ProfileDefinition/string]);

Drop field AutoKey;

1 Reply
grenwick
New Contributor III

Loading in Attribute Centric XML in QlikView Load Script

Hi,

I got a solution.

Basically loading 1 attribute value at a time using Where and then joining the attributes based on a RowNo() key.

ProfileDefinition:

LOAD

    RowNo() as AutoKey,

    string%Table as ID

WHERE name = 'ID';

LOAD string%Table, name

FROM C:\Test.xml (XmlSimple, Table is [list/ProfileDefinition/string]);

Join

LOAD

    RowNo() as AutoKey,

    string%Table as Name

WHERE name = 'name';

LOAD string%Table, name

FROM C:\Test.xml (XmlSimple, Table is [list/ProfileDefinition/string]);

Drop field AutoKey;

Community Browser