<?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 array values into multiple rows in Data Quality</title>
    <link>https://community.qlik.com/t5/Data-Quality/Split-array-values-into-multiple-rows/m-p/2492483#M4117</link>
    <description>&lt;P&gt;ohh, this is a nice one! You'll have to go row by row to get this right.&lt;/P&gt;
&lt;P&gt;First; determine how many 'parts' there are in the year or value field, by using Substringcount(year, ',')+1&lt;BR /&gt;(the number of comma's, plus 1)&lt;/P&gt;
&lt;P&gt;Then use a while loop and iterno() in a preceding load to match all of the parts using subfield:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; actionid,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; subfield(year, ',', iterno()) as year,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; subfield(value, ',', iterno()) as value&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;While iterno()&amp;lt;=i;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; actionid,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; year,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; value,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; substringcount(year, ',')+1 as i&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;From file;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2024 10:27:36 GMT</pubDate>
    <dc:creator>madelonjansen</dc:creator>
    <dc:date>2024-11-13T10:27:36Z</dc:date>
    <item>
      <title>Split array values into multiple rows</title>
      <link>https://community.qlik.com/t5/Data-Quality/Split-array-values-into-multiple-rows/m-p/2492439#M4113</link>
      <description>&lt;P&gt;I have .txt file where data looks like below:&lt;/P&gt;
&lt;P&gt;actionid | year | value&lt;BR /&gt;123 | [2024,2025] | [16,17]&lt;/P&gt;
&lt;P&gt;I need these record to split in two rows&lt;/P&gt;
&lt;P&gt;actionid | year | value&lt;BR /&gt;123 | 2024 | 16&lt;/P&gt;
&lt;P&gt;123 | 2025 | 17&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 07:07:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Split-array-values-into-multiple-rows/m-p/2492439#M4113</guid>
      <dc:creator>mohd_amzad9559</dc:creator>
      <dc:date>2024-11-13T07:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Split array values into multiple rows</title>
      <link>https://community.qlik.com/t5/Data-Quality/Split-array-values-into-multiple-rows/m-p/2492483#M4117</link>
      <description>&lt;P&gt;ohh, this is a nice one! You'll have to go row by row to get this right.&lt;/P&gt;
&lt;P&gt;First; determine how many 'parts' there are in the year or value field, by using Substringcount(year, ',')+1&lt;BR /&gt;(the number of comma's, plus 1)&lt;/P&gt;
&lt;P&gt;Then use a while loop and iterno() in a preceding load to match all of the parts using subfield:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; actionid,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; subfield(year, ',', iterno()) as year,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; subfield(value, ',', iterno()) as value&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;While iterno()&amp;lt;=i;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; actionid,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; year,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; value,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; substringcount(year, ',')+1 as i&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;From file;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 10:27:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Data-Quality/Split-array-values-into-multiple-rows/m-p/2492483#M4117</guid>
      <dc:creator>madelonjansen</dc:creator>
      <dc:date>2024-11-13T10:27:36Z</dc:date>
    </item>
  </channel>
</rss>

