<?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: Ranking with two dimensions issue. in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Ranking-with-two-dimensions-issue/m-p/2046834#M86103</link>
    <description>&lt;P&gt;Have you the sorting also applied to the Itname dimension? Further I think the sorting could be just sum(Amt) without the aggr() which is only needed within the calculated dimension to enforce there the NULL for the unwanted ranks.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2023 13:41:26 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2023-03-08T13:41:26Z</dc:date>
    <item>
      <title>Ranking with two dimensions issue.</title>
      <link>https://community.qlik.com/t5/App-Development/Ranking-with-two-dimensions-issue/m-p/2046810#M86102</link>
      <description>&lt;P&gt;Good afternoon.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to get the ranking as well as money value of the top 5 items per site.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have dimensions Site, Itname and a calculated dimension with the ranking. An there is 1 expressions summing the amounts. I use the same logic from the&amp;nbsp;calculated dimension to sort the dimensions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ranking calculated dim is:&amp;nbsp;&amp;nbsp;=if(aggr(rank(sum(Amt)),Site,Itname)&amp;lt;=5,aggr(rank(sum(Amt)),Site,Itname),null())&lt;/P&gt;
&lt;P&gt;The expression for Amount is:&amp;nbsp;sum(Amt).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue: Looking at the attached snippet you see there are 2 sites where the ranking goes wrong. I don't understand why it is correct for some sites but not all on them. If you can please let me know where I am going wrong.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Example of ranking" style="width: 324px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/102287i43CFC27B6F8E1A78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Example.PNG" alt="Example of ranking" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Example of ranking&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 13:22:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Ranking-with-two-dimensions-issue/m-p/2046810#M86102</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2023-03-08T13:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking with two dimensions issue.</title>
      <link>https://community.qlik.com/t5/App-Development/Ranking-with-two-dimensions-issue/m-p/2046834#M86103</link>
      <description>&lt;P&gt;Have you the sorting also applied to the Itname dimension? Further I think the sorting could be just sum(Amt) without the aggr() which is only needed within the calculated dimension to enforce there the NULL for the unwanted ranks.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 13:41:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Ranking-with-two-dimensions-issue/m-p/2046834#M86103</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-03-08T13:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking with two dimensions issue.</title>
      <link>https://community.qlik.com/t5/App-Development/Ranking-with-two-dimensions-issue/m-p/2046865#M86107</link>
      <description>&lt;P&gt;The closest I can get it:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sort Site by Text.&lt;/P&gt;
&lt;P&gt;ItName by&amp;nbsp;=sum(Amt)&lt;/P&gt;
&lt;P&gt;Ranking by&amp;nbsp;=sum(Amt) or Numeric. Now there is only one site where the numbers don't work out.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example.PNG" style="width: 324px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/102304i97690AA1EAB41462/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Example.PNG" alt="Example.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 14:11:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Ranking-with-two-dimensions-issue/m-p/2046865#M86107</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2023-03-08T14:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking with two dimensions issue.</title>
      <link>https://community.qlik.com/t5/App-Development/Ranking-with-two-dimensions-issue/m-p/2046886#M86109</link>
      <description>&lt;P&gt;Sorting pivots could become quite tricky. Maybe the following link (unfortunately it's archived and the link goes now to a cached version) is helpful (at least as starting-point for further investigations):&lt;/P&gt;
&lt;P&gt;&lt;A href="https://cc.bingj.com/cache.aspx?q=qlik+community%2c+perfectly+sorted+pivot&amp;amp;d=4630717985080081&amp;amp;mkt=de-DE&amp;amp;setlang=de-DE&amp;amp;w=sotGb9826eg5zrxT7xQ6mmQ216Zvu8RE" target="_blank"&gt;Perfectly Sorting Pivot Table (by A-Z. y-Value set... - Page 2 - Qlik Community - 1483393 (bingj.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Beside this you may also trying to transfer the logic from the (calculated) dimension into the expressions, for example with:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if(aggr(rank(sum(Amt)),Site,Itname)&amp;lt;=5,sum(Amt))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and similar with the rank (if showing this information is really important).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 14:38:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Ranking-with-two-dimensions-issue/m-p/2046886#M86109</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-03-08T14:38:18Z</dc:date>
    </item>
  </channel>
</rss>

