<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Split XML element in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171264#M21385</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your key point here is that the attributes can be in any order so looking for them in a fixed position doesn't work. Attached is a solution that uses preceding load to parse an arbitrary number of attributes in any order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;BillingAttributes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;lt;billing_attributes&amp;gt;Activity=AC32,Costcode=MIMO,Project=999&amp;lt;/billing_attributes&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;lt;billing_attributes&amp;gt;Costcode=ITD340,Project=999,Activity=AC37&amp;lt;/billing_attributes&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;] (delimiter is '|')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Attributes:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Generic LOAD RecId, Key, Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; RecId,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; SubField(Pair,'=',1) as Key,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; SubField(Pair,'=',2) as Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; RecId,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; SubField(Input,',') as Pair&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; RecNo() as RecId,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; TextBetween(BillingAttributes, '&amp;gt;', '&amp;lt;') as Input&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Resident Data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 May 2016 15:39:34 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2016-05-19T15:39:34Z</dc:date>
    <item>
      <title>Split XML element</title>
      <link>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171260#M21381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have problem that i cannot find solution for. I'm trying to split XML element containing text into 3 parts:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;&amp;lt;billing_attributes&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="text" style="color: #000000; font-family: monospace; font-size: 13px;"&gt;Activity=AC32,Costcode=MIMO,Project=999&lt;/SPAN&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;&amp;lt;/billing_attributes&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;&amp;lt;billing_attributes&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="text" style="color: #000000; font-family: monospace; font-size: 13px;"&gt;Costcode=ITD340,Project=999,Activity=AC37&lt;/SPAN&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;&amp;lt;/billing_attributes&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;or any other mix of Costcode, Project and Activity order in element.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;I need to separate fields Costcode, Project and Activity.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;&lt;SPAN class="html-tag" style="font-family: monospace; font-size: 13px;"&gt;I tried&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;TextBetween(billing_attributes,'Project=',',' or '&amp;lt;') as Project,&lt;/P&gt;&lt;P&gt;TextBetween(billing_attributes,'Costcode=',',' or '&amp;lt;') as "Cost code",&lt;/P&gt;&lt;P&gt;TextBetween(billing_attributes,'Activity=',',' or '&amp;lt;') as Activity&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;But it didn't work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your advice&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 14:26:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171260#M21381</guid>
      <dc:creator />
      <dc:date>2016-05-18T14:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Split XML element</title>
      <link>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171261#M21382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps like this:&lt;/P&gt;&lt;P&gt;SubField(Subfield(TextBetween(YourXmlFieldHere,'&amp;gt;','&amp;lt;'),',',1),'=',-1) as Project&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SubField(Subfield(TextBetween(YourXmlFieldHere,'&amp;gt;','&amp;lt;'),',',2),'=',-1) as "Cost code"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SubField(Subfield(TextBetween(YourXmlFieldHere,'&amp;gt;','&amp;lt;'),',',3),'=',-1) as Activity&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 16:37:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171261#M21382</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-05-18T16:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Split XML element</title>
      <link>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171262#M21383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In data model viewer it looks ok. But data are not connected. It doesn't pair with other lists of values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 07:25:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171262#M21383</guid>
      <dc:creator />
      <dc:date>2016-05-19T07:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Split XML element</title>
      <link>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171263#M21384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have no idea what you mean.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 13:03:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171263#M21384</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-05-19T13:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Split XML element</title>
      <link>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171264#M21385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your key point here is that the attributes can be in any order so looking for them in a fixed position doesn't work. Attached is a solution that uses preceding load to parse an arbitrary number of attributes in any order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;BillingAttributes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;lt;billing_attributes&amp;gt;Activity=AC32,Costcode=MIMO,Project=999&amp;lt;/billing_attributes&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;lt;billing_attributes&amp;gt;Costcode=ITD340,Project=999,Activity=AC37&amp;lt;/billing_attributes&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;] (delimiter is '|')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Attributes:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Generic LOAD RecId, Key, Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; RecId,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; SubField(Pair,'=',1) as Key,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; SubField(Pair,'=',2) as Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; RecId,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; SubField(Input,',') as Pair&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; RecNo() as RecId,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; TextBetween(BillingAttributes, '&amp;gt;', '&amp;lt;') as Input&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Resident Data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 15:39:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Split-XML-element/m-p/1171264#M21385</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2016-05-19T15:39:34Z</dc:date>
    </item>
  </channel>
</rss>

