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: 
Anonymous
Not applicable

[resolved] Convert XML to CVS using tFileInputXML

Hi, I have the following XML file that I need to output to CSV. The issue being that the A11_MV items are duplicated, but are correlative to the A15_MV items.
XML code:
<?xml version="1.0" encoding="UTF-8"?>
<ROOT
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
<CUSTOMER _ID = "2">
<A11_MV A11 = "C2000"/>
<A11_MV A11 = "M3000"/>
<A11_MV A11 = "S3000"/>
<A15_MV A15 = "8437"/>
<A15_MV A15 = "8437"/>
<A15_MV A15 = "8444"/>
</CUSTOMER>
<CUSTOMER _ID = "4">
<A11_MV A11 = "C3000"/>
<A15_MV A15 = "8439"/>
</CUSTOMER>
<CUSTOMER _ID = "6">
<A11_MV/>
<A15_MV/>
</CUSTOMER>
</ROOT>
The output I am looking for would be:
"2","C2000","8437"
"2","M3000","8437"
"2","S3000","8444"
"4","C3000","8439"
"6","",""
Any help would be greatly appreciated.
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello
You can use two tFileInputXML components to extract data from the same file, one extract _ID and A11 node, another one extract _ID and A15 node, then do a inner jon and merge columns on tMap. see my screenshots.
Best regards

shong

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hello
You can use two tFileInputXML components to extract data from the same file, one extract _ID and A11 node, another one extract _ID and A15 node, then do a inner jon and merge columns on tMap. see my screenshots.
Best regards

shong
Anonymous
Not applicable
Author

Thanks shong.. Works a treat.
Anonymous
Not applicable
Author

HI
When I am converting Xml to csv i am getting same output for the number of rows I have. My xml is
<?xml version="1.0" encoding="ISO-8859-15" ?>
- <root>
- <row>
<id>1</id>
<name>suresh</name>
</row>
- <row>
<id>2</id>
<name>naresh</name>
</row>
</root>
so there are two rows. So the output i am getting is
id;name
1;suresh
1;suresh
instead of
id;name
1;suresh
2;naresh
What is the solution to this? Please Help