<?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: Sorting in Pivot not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840100#M1001700</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Thanks Michael, but i don't understand by your statement:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;The aggr() returns an array of values, not one value".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;Can you plz explain this with example ??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jun 2015 15:21:05 GMT</pubDate>
    <dc:creator>nikhilgarg</dc:creator>
    <dc:date>2015-06-08T15:21:05Z</dc:date>
    <item>
      <title>Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840091#M1001691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I am trying to sort the data in my Pivot table based on expressions but it is not appling to Desk = 'Others'.&lt;/P&gt;&lt;P&gt;I ahve attached the excel sheet and .qvw . Please let me know about the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2015 12:23:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840091#M1001691</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-06-06T12:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840092#M1001692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not a solution, but explanation:&lt;/P&gt;&lt;P&gt;The value of the sort expression for Desk is evaluated over the whole selected data set (just select any R1 to see), not per value of the first dimension (R1).&amp;nbsp; It is impossible to have different sorting of dimension 2 for the different dimension 1 values.&lt;/P&gt;&lt;P&gt;Solution - I think I had something similar, cant recall the details at this time, but I certainly used a straight table and likely a data island to resolve it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2015 12:53:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840092#M1001692</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-06T12:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840093#M1001693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Thanx michael. When we select the Region it is working fine. Then why not when we donot select any region?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I couldn't understand your statement :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;The value of the sort expression for Desk is evaluated over the whole selected data set &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;not per value of the first dimension (R1).&amp;nbsp; It is impossible to have different sorting of dimension 2 for the different dimension 1 values.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;can you plz explain ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2015 13:16:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840093#M1001693</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-06-06T13:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840094#M1001694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Nikhil.&lt;/P&gt;&lt;P&gt;Dimension 2 is always sorted in the same order, for each value of the dimension 1, e.g.:&lt;/P&gt;&lt;P&gt;USA&amp;nbsp; A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; F&lt;/P&gt;&lt;P&gt;Canada&amp;nbsp; A&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; D&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; F&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It simply cannot be ADF for USA but DAF for Canada - pivot table simply doesn't work this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The order of the second dimension is defined by your expression correctly, and the is evaluated over all the selected data.&amp;nbsp; It behaves the way as if the Dimension 1 doesn't exist.&amp;nbsp; To test - remove dimension R1 from you table, and see how it is sorted.&amp;nbsp; The &lt;STRONG&gt;same exact&lt;/STRONG&gt; way it will be sorted in your table with R1 for each R1 value.&amp;nbsp; This is how it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2015 13:29:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840094#M1001694</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-06T13:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840095#M1001695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Thanks Michael. But i have attached my app and excel sheet in this reply. I would like to ask few qstns when Login is selected as Sorting filter :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1: The Order for D1 for very first value of R1 is B,D,A.&amp;nbsp; It means for every upcoming R1, order for D1 should be B,D,A. Then why for USA , the order is broken. It's order is: F,B,Z,D,A. Why F at top a nd Z in between B and D ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2: Also for Others, Sorting is not correct. It is 25, 21, 21 and 25. Why is it so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you&amp;nbsp; plz explain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2015 14:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840095#M1001695</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-06-06T14:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840096#M1001696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not exactly...&lt;/P&gt;&lt;P&gt;You assumption that sort is defined by the "very first value of R1" is nor correct.&lt;/P&gt;&lt;P&gt;I'm attaching your application with an additional table which has only one dimension Desk.&amp;nbsp; It shows what exactly sorting order for this calculated dimension will be.&amp;nbsp; It does change if you make selections or change sorting in the filter above of course.&lt;/P&gt;&lt;P&gt;So, the order is F, X, B, Z, D, A, Others.&amp;nbsp; In the pivot table, some of the Desk values don't exist for some of R1, values.&amp;nbsp; For example, R1 Others has only three Desk values - and they are sorted in the order you see in the "Sorting Rules" table.&amp;nbsp; Take a careful look, you see that the order is the same, just some values are missing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2015 16:02:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840096#M1001696</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-06T16:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840097#M1001697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nikhil,&lt;/P&gt;&lt;P&gt;The Michael' s answer is correct.&lt;/P&gt;&lt;P&gt;However, an idea could be (is only an idea)&lt;/P&gt;&lt;P&gt;in script&lt;/P&gt;&lt;P&gt;Load ....&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;D1&lt;/SPAN&gt;='Unassigned' &lt;SPAN style="color: #0000ff;"&gt;or&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;IsNull&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;D1&lt;/SPAN&gt;),'Others'&amp;amp;' '&amp;amp;&lt;SPAN style="color: #800000;"&gt;R1&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;D1&lt;/SPAN&gt;) &lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;D1&lt;/SPAN&gt;,&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;from ...;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;And in Dimension -&amp;gt; D1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;So, You solve this issue, but it might not work for another.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Antonio&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jun 2015 19:03:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840097#M1001697</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2015-06-06T19:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840098#M1001698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Hello,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I am trying to sort on baisi of Login using aggr function but it is giving me some absurd order in my attached app.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Can anyone help me on this ?&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 10:27:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840098#M1001698</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-06-08T10:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840099#M1001699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The aggr() returns an array of values, not one value. Try to add sum():&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;login&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;R1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;D1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It doesn't resolve your original problem, but at least the result is predictable - in your case, by Login, descending.&amp;nbsp; Follows the same pivot table rules as I described above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 14:06:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840099#M1001699</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-08T14:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840100#M1001700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Thanks Michael, but i don't understand by your statement:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;The aggr() returns an array of values, not one value".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;Can you plz explain this with example ??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 15:21:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840100#M1001700</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-06-08T15:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot not working</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840101#M1001701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let me try...&lt;/P&gt;&lt;P&gt;Say, you have sales by Country by Year:&lt;/P&gt;&lt;P&gt;Canada&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2015&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; 45&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 35&lt;/P&gt;&lt;P&gt;USA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 145&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 235&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of aggr(sum(Sales), Country) returns array:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;80, 380&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;where 80 is for Canada and 380 for USA.&lt;/P&gt;&lt;P&gt;To use it, you need to aggregate it further, to get sum, or avg, or min, or max...&amp;nbsp; For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(sum(Sales), Country)) returns 460&lt;/P&gt;&lt;P&gt;avg(aggr(sum(Sales), Country)) returns 230&lt;/P&gt;&lt;P&gt;max(aggr(sum(Sales), Country)) returns 380&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 15:35:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-not-working/m-p/840101#M1001701</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-08T15:35:29Z</dc:date>
    </item>
  </channel>
</rss>

