Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Yukeer
Contributor
Contributor

Is it possible to merge entities with same ids but with different nested entities in XML ?

Hello,

i'm currently searching for a solution to my use case.

Here is the thing. I have a temporary csv file filled from a SQL function. Each line outputs values with a '|' delimiter.

Example :

ThingId | ThingName | JoinNestedId | JoinNestedName

1 | Foo | 10 | NestedFoo

2 | Foo2 | 11 | NestedFoo2

2 | Foo2 | 12 | NestedFoo3

However, when I want to map these lines into a tAdvancedFileOutputXML, the entity with id = 2 is split.

<mylistofthings>

<thing>

<id>1</id>

<name>Foo</name>

<nestedobjects>

<nestedobject>

<id>10</id>

<name>NestedFoo</name>

</nestedobject>

</nestedobjects>

</thing>

<thing>

<id>2</id>

<name>Foo2</name>

<nestedobjects>

<nestedobject>

<id>11</id>

<name>NestedFoo2</name>

</nestedobject>

</nestedobjects>

</thing>

<thing>

<id>2</id>

<name>Foo2</name>

<nestedobjects>

<nestedobject>

<id>12</id>

<name>NestedFoo3</name>

</nestedobject>

</nestedobjects>

</thing>

</mylistofthings>

 

The nestedobjects field is set as a Group, the nestedobject field is set as a Loop.

I tried tUnite, tFileOutputMSXML, tAggregateRow, tUniqRow, tSurviveFields. It seems that none of these components fits my use case, unless you contradict me.

How can I ensure that the thing with id = 2 has one single list of nestedobjects with both id 11 and 12, like this ?

 

<thing>

<id>2</id>

<name>Foo2</name>

<nestedobjects>

<nestedobject>

<id>11</id>

<name>NestedFoo2</name>

</nestedobject>

<nestedobject>

<id>12</id>

<name>NestedFoo3</name>

</nestedobject>

</nestedobjects>

</thing>

Labels (3)
1 Reply
gjeremy1617088143

Hi have you try the component tWriteXmlField with the group by option ?

Send me love and kudos