<?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: Sort and group in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sort-and-group-in-script/m-p/1058645#M640524</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I understand (and I might be wrong about it), you can't group and sort by a new calculated field in the same statement. Here is what's stated in QlikView Help:&lt;/P&gt;&lt;P&gt;================================&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;order by&lt;/SPAN&gt; is a clause used for sorting the records of a resident table before they are processed by the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;load&lt;/SPAN&gt; statement. The resident table can be sorted by one or more fields in ascending or descending order. The sorting is made primarily by numeric value and secondarily by national ASCII value. This clause may only be used when the data source is a resident table&lt;/P&gt;&lt;P&gt;================================&lt;/P&gt;&lt;P&gt;Based on that, you should first group your data, and then reload the same table again in a resident load and sort it using the ORDER BY clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;Upgrade your Qlik skills at the &lt;A href="http://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt; - coming soon to Milan, Italy and Austin, TX!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Feb 2016 00:06:01 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2016-02-18T00:06:01Z</dc:date>
    <item>
      <title>Sort and group in script</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-and-group-in-script/m-p/1058643#M640522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Qlik community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Advise me pls on the question - I need to group &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Net_Sales&lt;/STRONG&gt; in&lt;/SPAN&gt; script by &lt;STRONG&gt;Customer&lt;/STRONG&gt;, than sort by &lt;STRONG&gt;Net_Sales&lt;/STRONG&gt; with &lt;SPAN style="text-decoration: underline;"&gt;descending&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;What I'm trying to perform:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt; Cust &lt;STRONG&gt;as&lt;/STRONG&gt; Customer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;sum&lt;/STRONG&gt;([Sales net]) &lt;STRONG&gt;as&lt;/STRONG&gt; Net_Sales&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident&lt;/STRONG&gt; SalesTable&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group by&lt;/STRONG&gt; &lt;SPAN style="font-size: 13.3333px;"&gt;Cust &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Order By&lt;/STRONG&gt; &lt;SPAN style="font-size: 13.3333px;"&gt;[Sales net]&lt;/SPAN&gt; &lt;STRONG&gt;desc&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 23:18:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-and-group-in-script/m-p/1058643#M640522</guid>
      <dc:creator />
      <dc:date>2016-02-17T23:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sort and group in script</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-and-group-in-script/m-p/1058644#M640523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The order by clause is sorting the input records, not the output records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[From the HELP:&lt;/P&gt;&lt;TABLE cellspacing="0" class="TableStyle-tableGrid" style="margin-right: auto;"&gt;&lt;TBODY&gt;&lt;TR class="Body-Body1"&gt;&lt;TD class="BodyC--" data-mc-conditions="Primary.NotToTranslate"&gt;order_by&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD class="BodyA--"&gt;&lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate"&gt;order by&lt;/SPAN&gt;&amp;nbsp; is a clause used for sorting the records of a resident table before they are processed by the &lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate"&gt;load&lt;/SPAN&gt; statement&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you would need a subsequent LOAD to order your aggregated values as demanded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 23:58:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-and-group-in-script/m-p/1058644#M640523</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-17T23:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sort and group in script</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-and-group-in-script/m-p/1058645#M640524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I understand (and I might be wrong about it), you can't group and sort by a new calculated field in the same statement. Here is what's stated in QlikView Help:&lt;/P&gt;&lt;P&gt;================================&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;order by&lt;/SPAN&gt; is a clause used for sorting the records of a resident table before they are processed by the &lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;load&lt;/SPAN&gt; statement. The resident table can be sorted by one or more fields in ascending or descending order. The sorting is made primarily by numeric value and secondarily by national ASCII value. This clause may only be used when the data source is a resident table&lt;/P&gt;&lt;P&gt;================================&lt;/P&gt;&lt;P&gt;Based on that, you should first group your data, and then reload the same table again in a resident load and sort it using the ORDER BY clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;Upgrade your Qlik skills at the &lt;A href="http://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt; - coming soon to Milan, Italy and Austin, TX!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Feb 2016 00:06:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-and-group-in-script/m-p/1058645#M640524</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2016-02-18T00:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sort and group in script</title>
      <link>https://community.qlik.com/t5/QlikView/Sort-and-group-in-script/m-p/1058646#M640528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jinx!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Feb 2016 00:06:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sort-and-group-in-script/m-p/1058646#M640528</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2016-02-18T00:06:28Z</dc:date>
    </item>
  </channel>
</rss>

