Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
bramvdpoel
Contributor III
Contributor III

XML Load same attributes

Hi,

I'm trying to load an xml file into qlikview, this it self doesnt form a problem. But some key field have multiple attributes with the same field name.

 

XML example:

 

<artikel id="MSN-1362211">
<afbeeldingen><afbeelding hash="ad4f280203ea8339ee5a4762ee047149"><![CDATA[https://***/images/Naaldvilt matten set.jpg]]></afbeelding>
<afbeelding hash="093b525f8b1df17cc2843fdb8405cf1f"><![CDATA[https://***/images/MSN-1362211.jpg]></afbeelding>
</afbeeldingen>
</artikel>

 

Result now:

idafbeelding
MSN-1362211https://***/images/Naaldvilt matten set.jpg
MSN-1362211https://***/images/MSN-1362211.jpg

 

What i would like:

idAfbeelding1Afbeelding2
MSN-1362211https://***/images/Naaldvilt matten set.jpghttps://***/images/MSN-1362211.jpg

 

Can anyone help please?

3 Replies
Anil_Babu_Samineni

Perhaps this?

XMLData:
LOAD id,
RowNo() as Status,
afbeelding
FROM
[https://community.qlik.com/t5/New-to-QlikView/XML-Load-same-attributes/m-p/1654918#M384350]
(html, utf8, embedded labels, table is @1);

FinalTable:
LOAD Distinct id
Resident XMLData;

FOR i = 1 to FieldValueCount('Status')

LET vField = FieldValue('Status', $(i));

Left Join (FinalTable)
LOAD id,
afbeelding as [afbeelding $(vField)]
Resident XMLData
Where Status = $(vField);

NEXT i;

DROP Table XMLData;

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Brett_Bleess
Employee
Employee

Did Anil's suggestion work to solve your use case?  If so, do not forget to return to your post and use the Accept as Solution button on his post to give him credit for the assistance as well as let other Community Members know this worked.  The only other solution would be to update the xml schema I believe, as that should be from where we are pulling things...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
bramvdpoel
Contributor III
Contributor III
Author

It's definitly an option, it works but takes a lot of time when you have 35.000 rows.

But the best option so far! Thx