Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Parsing Complex XML to all levels and converting to a Tabular format

pankajk
10 - Fireball

Have you run onto challenges when it comes to parsing XML files and trying to convert data to a ‘meaningful' tabular format? I had my share of fun and challenge. Especially if the XML is nested to multi-level. Analysis on data from XML files is one of the issues I have faced recently. The file (nodes and data) was next 13 levels deep with ~350 data fields to capture; and goal was to convert it to a tabular data and share on a SQL server to allow our partners to be able to use this data for different use cases including Quality Validation.

 

There are several macros available for parsing XML data in Alteryx community. I used Parse XML which is a powerful macro which can parse an XML file for all levels. This macro if used properly is awesome and reduces a lot of stress to deal with XML files.

 

I am going to show you an example where I will parse the "<body>" of the XML which generally has the most complex data. You can view another example of this on Alteryx Community by clicking here.

 

The example I am using is simple XML on 'Donuts' 😊

 

Every XML is different, but this macro will parse all nodes and data. After parsing, different techniques can be used to convert 'parsed' to a 'meaningful' data in tabular format.

 

I have provided some tips below on how to start parsing complex XMLs. A workflow is also attached to convert "Donuts.xml" to a tabular data format. If the data is required to be loaded to a Database server, I would recommend that you NORMALIZE data before loading. In the donuts example, you can have different tables for "Donut Master", "Filling Master", "Topping Master" and "Batter Master" and then 1 transaction file for "Donut Transactions".

 

Download the Parse XML macro here: https://gallery.alteryx.com/#!app/Parse-XML/584b5589f499c704689e363b

 

Credits:  

Hildebrando Souza (https://community.alteryx.com/t5/user/viewprofilepage/user-id/51984)

Chris Smallwood (https://community.alteryx.com/t5/user/viewprofilepage/user-id/68765)

 

 

I have attached sample XML file, workflow and post (which includes steps and details)........looking forward to feedback and other ideas from friends on how they solved their XML file transformation issues.

 

Happy XML Parsing with Alteryx!

 

Pankaj

 

7 REPLIES 7
saimathangi
7 - Meteor

@pankajk - The link you provided is not opening the macro for me. It is redirecting me to community search. Can you please help me with the correct link?

SHETTYAB
5 - Atom

Parse XML tool is really good. However, can't find it in Alteryx. I am also not able to find it in the link provided.

rohit782192
11 - Bolide

Unable to See the Parse XML. Can you paste the correct link or the attached macro.

edevoucalla
5 - Atom

Similar to the others on this thread, I can't find the ParseXML tool, could you re-post it??

 

edevoucalla
5 - Atom

This s a super powerful macro!! Thanks for sharing!

 

rohit782192
11 - Bolide

I don't see the macro can you paste the link

Dlians
6 - Meteoroid

Hi everyone, 

I was looking for the macro as well and finally found a copy of the macro on another post. Here is the link to the post. Look for parse XML.yxzp attached to the post. 

 

https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Parse-XML-with-multiples-tag-t...

Labels