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: 
McJingles
Contributor III
Contributor III

how to extract data from xml tags which have same tag name and add into one column.?

Hi.!

 

The input is 

<root> <root> <id>1</id> <FN>aa</FN> <roles>bb</roles> <roles>cc</roles> <roles>dd</roles> <roles>ee</roles> </root> </root>
 
but I need to get add the roles in the single column like this 
id  FN  roles
1  aa   bb,cc,ee,dd
 
Thanks in advance.!
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Do you know how many roles elements you will have in your XML? If so you can get them using the following method.

 

Your XPath loop will be.....

"/root/root"

You can get the first "roles" value using this....

"roles[1]"

....the second using this....

"roles[2]"

....etc, etc...

 

You would then merge them together, maybe using a tMap

View solution in original post

2 Replies
Anonymous
Not applicable

Do you know how many roles elements you will have in your XML? If so you can get them using the following method.

 

Your XPath loop will be.....

"/root/root"

You can get the first "roles" value using this....

"roles[1]"

....the second using this....

"roles[2]"

....etc, etc...

 

You would then merge them together, maybe using a tMap

McJingles
Contributor III
Contributor III
Author

Thanks, @rhall  It worked...