<?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: Loop or other suggestions? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651040#M1066891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All the answers are correct but Marco had the easiest one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I had in mind to solve it was making several loads of the table where each load contains a unique value from the field "GROUP". I think this is still possible but not the best way to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Johnni Kirstein&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Sep 2014 05:34:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-09-09T05:34:47Z</dc:date>
    <item>
      <title>Loop or other suggestions?</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651035#M1066878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me solve this one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attached file I have the sheet "Base", where I have sorted the fields "NAME" and "GROUP" based on the field "PRIORITY_ALL".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to loop the table into a new table where all the names are given a new priority called "PRIORITY_GROUP" based on their priority in "PRIORITY_ALL" and which group in "GROUP" they belong to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have manually illustrated the result it's supposed to be in the sheet "After group priority".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally it should be used for creating a pivot table as seen in the sheet "Pivot solution" if it makes more sense to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really hope you can help me with this Little issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Johnni Kirstein&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2014 18:16:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651035#M1066878</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-08T18:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Loop or other suggestions?</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651036#M1066880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's easy enough. Assuming your first table is named "data" then you can do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(GROUP = previous(GROUP),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; peek(PRIORITY_GROUP)+1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) as PRIORITY_GROUP&lt;/P&gt;&lt;P&gt;RESIDENT data&lt;/P&gt;&lt;P&gt;ORDER BY GROUP,PRIORITY_ALL&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2014 18:22:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651036#M1066880</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-09-08T18:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Loop or other suggestions?</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651037#M1066882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached qvw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2014 18:28:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651037#M1066882</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-09-08T18:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Loop or other suggestions?</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651038#M1066884</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;one possible solution for your sample data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14102059304227713" jivemacro_uid="_14102059304227713"&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoNumber(PRIORITY_ALL, GROUP) as PRIORITY_GROUP&lt;/P&gt;
&lt;P&gt;FROM [Sandbox_Loop.xlsx] (ooxml, embedded labels, table is Base);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_132432_Pic1.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/66283_QlikCommunity_Thread_132432_Pic1.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2014 19:51:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651038#M1066884</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-09-08T19:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Loop or other suggestions?</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651039#M1066887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for unsorted input tables you could extend this solution to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14102064421009216" jivemacro_uid="_14102064421009216"&gt;
&lt;P&gt;tab1:&lt;/P&gt;
&lt;P&gt;LOAD * FROM [Sandbox_Loop.xlsx] (ooxml, embedded labels, table is Base);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join&lt;/P&gt;
&lt;P&gt;LOAD NAME, AutoNumber(PRIORITY_ALL, GROUP) as PRIORITY_GROUP&lt;/P&gt;
&lt;P&gt;Resident tab1&lt;/P&gt;
&lt;P&gt;Order By PRIORITY_ALL;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2014 20:00:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651039#M1066887</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-09-08T20:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Loop or other suggestions?</title>
      <link>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651040#M1066891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All the answers are correct but Marco had the easiest one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I had in mind to solve it was making several loads of the table where each load contains a unique value from the field "GROUP". I think this is still possible but not the best way to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Johnni Kirstein&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Sep 2014 05:34:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loop-or-other-suggestions/m-p/651040#M1066891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-09T05:34:47Z</dc:date>
    </item>
  </channel>
</rss>

