Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAMy solution without a "Parse tool".
Used one RegEx tool, cleaned up the data and combined it after a CrossTab tool.
Here is my solution
Was thinking python was going to be a bit easier to parse, but couldn't get it to work out how i wanted, went back to xml tool (which can be very tedious with nested data)
Edit: found i had to use json.dumps() for the final cleansing of the data in python
from ayx import Alteryx
import json
import xmltodict
df = Alteryx.read('#1')
df['json'] = df.apply(lambda x:
json.dumps(
xmltodict.parse(
x['customer_OuterXML']))
,axis=1)
Alteryx.write(df,3)
handled the json cross tab outside of python, but that could likely be handled just the same within python all the same.
#SnakingMyWayThruChallenges
Took me quite a long time as I am not familar with XML parsing. My solution felt pretty clumsy, so I reckon there are easier ways to do this.
That was a bit messy with quite a few manual renaming going on inside the Join tool to get the names exactly the same. Still managed to get the right result