<?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: how to sort top 5 within Pivot table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023509#M346084</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the sample chart could be just sorted by y-value desc to return the requested result. But that's just because the first dimension should be sorted A-Z and this by accident matches sort order by y-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To explicitely sort first dimension A-Z and second by v-value desc, set the sort order to y-value asc and create the first expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pick(Dimensionality(),&lt;/P&gt;&lt;P&gt;[$(=GetObjectField(0))],&lt;/P&gt;&lt;P&gt;-Column(2)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't hide the first expression column, but you can set the column width to zero. There is a macro in my sample app that does this (only need to be executed once during development).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's all described here (kudos! &lt;A href="https://community.qlik.com/qlik-users/20543"&gt;cschwarz&lt;/A&gt;‌)&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-7220"&gt;Perfectly Sorting Pivot Table (by A-Z. y-Value set for each dim-level)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Mar 2016 01:35:23 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-03-08T01:35:23Z</dc:date>
    <item>
      <title>how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023500#M346075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Group&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Vendor&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID Counts&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;46&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a pivot table where I am counting IDs (3rd column above) for top 5 vendors grouping by Group. Within Groups, only A is shown here, I want the ID Counts to sort in descending order. So in the table above it sud be in 200,46,13,12,2 order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following expn to count IDs: sum(aggr(if((rank(count({ fieldA = {1}&amp;gt;} ID))) &amp;lt;=5,count({&amp;lt;FieldA = {1}&amp;gt;} ID)),Group, Vendor))&lt;/P&gt;&lt;P&gt;How do I make it to sort within the group with max count at the top?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 00:28:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023500#M346075</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-25T00:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023501#M346076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide a sample to play around with?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 00:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023501#M346076</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-25T00:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023502#M346077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=max((Group,5),vendor)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 05:13:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023502#M346077</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2016-02-25T05:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023503#M346078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you check this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/67816"&gt;Calculating TOP 10 VALUES in PIVOT TABLE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/106827"&gt;Pivot Table top 10&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/5897"&gt;how to display top 5 customers in pivot table&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 05:22:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023503#M346078</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-25T05:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023504#M346079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@SunnY T,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the qvw. I want to sort first by A-Z Group, then within group I want the vendor with max count at the top.&lt;/P&gt;&lt;P&gt;for EG. for Group A, it shoule be Vendor 1,2,3,4,5 in that order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="rank_sort.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/117255_rank_sort.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 19:53:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023504#M346079</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-07T19:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023505#M346080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/171708"&gt;sunindia&lt;/A&gt;‌ ..?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 21:30:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023505#M346080</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-07T21:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023506#M346081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No man, I have run out of options. May be &lt;A href="https://community.qlik.com/qlik-users/15823"&gt;swuehl&lt;/A&gt;‌ can help you out &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 21:32:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023506#M346081</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-07T21:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023507#M346082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking for something like this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 01:02:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023507#M346082</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-08T01:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023508#M346083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefan would you be able to elaborate what you did? Why is $Sort expression not visible in the pivot table? Is there a way to hide an expression from Pivot table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 01:24:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023508#M346083</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-03-08T01:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023509#M346084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the sample chart could be just sorted by y-value desc to return the requested result. But that's just because the first dimension should be sorted A-Z and this by accident matches sort order by y-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To explicitely sort first dimension A-Z and second by v-value desc, set the sort order to y-value asc and create the first expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pick(Dimensionality(),&lt;/P&gt;&lt;P&gt;[$(=GetObjectField(0))],&lt;/P&gt;&lt;P&gt;-Column(2)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't hide the first expression column, but you can set the column width to zero. There is a macro in my sample app that does this (only need to be executed once during development).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's all described here (kudos! &lt;A href="https://community.qlik.com/qlik-users/20543"&gt;cschwarz&lt;/A&gt;‌)&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-7220"&gt;Perfectly Sorting Pivot Table (by A-Z. y-Value set for each dim-level)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 01:35:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023509#M346084</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-08T01:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023510#M346085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;sunindia&lt;/A&gt;‌&amp;nbsp; and &lt;A href="https://community.qlik.com/qlik-users/15823"&gt;swuehl&lt;/A&gt;‌ for helping out. I will implement these in my app and update.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 02:13:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023510#M346085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-08T02:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023511#M346086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works almost perfectly. But my actual app has one more condition; the order of the Group is not "Normal".&lt;/P&gt;&lt;P&gt;from the image below: The user wants the sort order to be B -101, A -102, D -103, C -104. How to make this possible.&lt;/P&gt;&lt;P&gt;I thought we had this under control. Thanks for your help again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="rank_sort_2.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/117366_rank_sort_2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 13:56:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023511#M346086</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-08T13:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort top 5 within Pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023512#M346087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe use a $Sort expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pick(Dimensionality(),&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Subfield([$(=GetObjectField(0))],'-',2),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-Column(2)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 14:17:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-sort-top-5-within-Pivot-table/m-p/1023512#M346087</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-08T14:17:11Z</dc:date>
    </item>
  </channel>
</rss>

