<?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: Load Script Question - Populate number groups in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838212#M659964</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anbu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the above script! This script is very close to solving my issue but I spotted an issue with it. I've added a new field, Cost, below to highlight what happens when I run the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="DummyData.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/83054_DummyData.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;So the script does create the field 'Desired Result' as requested but in doing so it replicates the data in the first 3 rows (ie) all of the data from row 1 appears three times in the output data, row 2 appears twice, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm after is the column 'Desired Result' but with no other changes to the existing data, so in this case Cost would remain unchanged (Desired Cost) rather than end up like the 'Current Cost' field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this makes sense and thanks again for picking this up!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Apr 2015 16:24:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-04-07T16:24:24Z</dc:date>
    <item>
      <title>Load Script Question - Populate number groups</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838210#M659962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the below requirement, any suggestions on how I could do this in the load script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="DummyData.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/82719_DummyData.PNG" style="height: auto;" /&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;For the same ID I need to create a new field which contains numbers starting from 1 and grouping by the GroupCount value (ex) the first GroupCount value is 3 so we populate the first 3 rows with 1, the second GroupCount value is 2 so we populate the next 2 rows with 2 etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 15:41:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838210#M659962</guid>
      <dc:creator />
      <dc:date>2015-04-01T15:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script Question - Populate number groups</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838211#M659963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14279625682124610 jive_text_macro" jivemacro_uid="_14279625682124610"&gt;
&lt;P&gt;Temp:&lt;/P&gt;
&lt;P&gt;Load *,AutoNumber(RowNo(),ID) As Result;&lt;/P&gt;
&lt;P&gt;Load * Inline [&lt;/P&gt;
&lt;P&gt;ID,GroupCount&lt;/P&gt;
&lt;P&gt;TEST1,3&lt;/P&gt;
&lt;P&gt;TEST1,2&lt;/P&gt;
&lt;P&gt;TEST1,4 ];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Final:&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;Load *,RowNo() Resident Temp While IterNo() &amp;lt;= GroupCount;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Temp;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 08:16:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838211#M659963</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2015-04-02T08:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script Question - Populate number groups</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838212#M659964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anbu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the above script! This script is very close to solving my issue but I spotted an issue with it. I've added a new field, Cost, below to highlight what happens when I run the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="DummyData.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/83054_DummyData.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;So the script does create the field 'Desired Result' as requested but in doing so it replicates the data in the first 3 rows (ie) all of the data from row 1 appears three times in the output data, row 2 appears twice, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm after is the column 'Desired Result' but with no other changes to the existing data, so in this case Cost would remain unchanged (Desired Cost) rather than end up like the 'Current Cost' field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this makes sense and thanks again for picking this up!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 16:24:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838212#M659964</guid>
      <dc:creator />
      <dc:date>2015-04-07T16:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script Question - Populate number groups</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838213#M659965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14284249988563338 jive_text_macro" jivemacro_uid="_14284249988563338"&gt;
&lt;P&gt;Final:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Load *,RowNo() As RowNo Inline [&amp;nbsp; &lt;/P&gt;
&lt;P&gt;ID,GroupCount,Cost&amp;nbsp; &lt;/P&gt;
&lt;P&gt;TEST1,3,4&lt;/P&gt;
&lt;P&gt;TEST1,2,8&amp;nbsp; &lt;/P&gt;
&lt;P&gt;TEST1,4,9&lt;/P&gt;
&lt;P&gt;TEST1,,8&lt;/P&gt;
&lt;P&gt;TEST1,,6&lt;/P&gt;
&lt;P&gt;TEST1,,2&lt;/P&gt;
&lt;P&gt;TEST1,,1&lt;/P&gt;
&lt;P&gt;TEST1,,7&lt;/P&gt;
&lt;P&gt;TEST1,,6 ];&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Join(Final)&lt;/P&gt;
&lt;P&gt;Load ID,Result,RowNo() As RowNo While IterNo() &amp;lt;= GroupCount;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Load ID,AutoNumber(ID&amp;amp;GroupCount) As Result,GroupCount Resident Final Where IsNum(GroupCount);&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 16:44:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838213#M659965</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2015-04-07T16:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script Question - Populate number groups</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838214#M659966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect, thanks for the quick turnaround, the script worked a treat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tweaked it slightly as the above didn't work if the GroupCount value was the same for all rows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AutoNumber(ID&amp;amp;GroupCount&lt;STRONG&gt;&amp;amp;RowNo&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Question-Populate-number-groups/m-p/838214#M659966</guid>
      <dc:creator />
      <dc:date>2015-04-07T17:02:46Z</dc:date>
    </item>
  </channel>
</rss>

