Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

How Can I Parse a Specific Child Element?

hellyars
13 - Pulsar

This is a recurring nightmare for me.   My XML datasource re-uses element names over and over again.  I can't change this.

 

I want to target the "Cost" that is the direct child of ITEM.  I do NOT want the elements named "Cost" that are the grandchildren of Parent.    The actual dataset is more complicated.  I walk down to Parent using the Parse Tool with XML Element to Parse set to Specific Child Name: "Cost."  But, the Parse tool returns all the descendants of ITEM named "Cost", not just the child.   So, one row becomes 3 rows with the wrong sum.   Sum tool and Unique tools don't fix this.  

 

"ITEM"

  • Hardware
    • Cost
      • Yr1
      • Yr2
      • Yr3
  • Installation
    • Cost
      • Yr1
      • Yr2
      • Yr3
  • COST
    • Yr1
    • Yr2
    • Yr3Can
2 REPLIES 2
BenMoss
ACE Emeritus
ACE Emeritus
Im sure the answer is yes but its extrnely hard to debug without some sample data; could you plwase share if possible?

Ben
hellyars
13 - Pulsar

I can work around this problem if I parse the root of the child and return its children and return the outer XML of the its children.  

Labels
Top Solution Authors