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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
KevSan
Contributor II
Contributor II

tXMLMap - part without loop and part with loop

Hi everybody,

I would like to transform one XML (XML.png) into a positional file by using some XML tag (without loop -> <Site> and <Orderdetails> before <OrderLine>) and some XML tag within a loop (<OrderLine>).

Unfortunately, I'm stuck. I can extract the unloop information I want but I do not know how to get the expected result (ExpectedResult.PNG).

You can find my tFileInputXML and my tXMLMap in the uploaded files.

Can someone please help me for this?

Have a nice day.

Labels (3)
4 Replies
Anonymous
Not applicable

Hi

What is the result you are getting now? Can't read data from <site> tag?

 

Regards

Shong​

KevSan
Contributor II
Contributor II
Author

0695b00000OBfX9AAL.pngThis is what I get ...

 

Information from Site Tag and OrderDetails Tag are repeated -> but I don't want 😞

 

Do you know what I can do for my problem?

 

Regards.

Anonymous
Not applicable

write the first line to a new file, then append the second line to existing file, finally, append the records in loop tag to the existing file. The job looks like:

tFileInputXML--main--tHashOutput1(cache all data in memory for used later)

|onsubjobok

tHashInput1--tMap--tFileOutputDelimited1

|onsubjobok

tHashInput2--tMap--tFileOutputDelimited2 (append the second line to existing file created by tFileOutputDelimited1)

|onsubjobok

tHashInput3--tMap--tFileOutputDelimited3 ((append the records in loop tag to existing file created by tFileOutputDelimited1)

tHashInput1,2,3: read the required columns from tHashOutput1.

 

Hope it helps.

 

Regards

Shong

KevSan
Contributor II
Contributor II
Author

Hi @Shicong Hong​ , I understand the principles but unfortunatley tHashOutput is not in my version.

 

How can I do so ?

 

Thanks for your time !