<?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: Count of Values from Rank &amp;gt; n in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-of-Values-from-Rank-gt-n/m-p/1015706#M344241</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Managed to do it with a calculated dimension, instead of Corporation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(aggr(rank(TOTAL sum(Value)), Corporation) &amp;lt;= 10 OR Corporation = 'Corp7' OR Corporation = 'Corp9', aggr(rank(TOTAL sum(Value)), Corporation), 'Others')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, for the sorting to don´t be messed up, used this ascending:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(aggr(rank(TOTAL sum(Value)), Corporation) &amp;lt;= 10 OR Corporation = 'Corp20' OR Corporation = 'Corp10', aggr(rank(TOTAL sum(Value)), Corporation), 9999)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where the 9999 would be a safe limit that wouldn't be reached by the slider.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached file with solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Mar 2016 17:31:26 GMT</pubDate>
    <dc:creator>kira_whopper</dc:creator>
    <dc:date>2016-03-17T17:31:26Z</dc:date>
    <item>
      <title>Count of Values from Rank &gt; n</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-Values-from-Rank-gt-n/m-p/1015705#M344240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to show in a chart the Sum of Sales of some Corporations and a Rank based on the limit defined in a slider (set in Dimension Limit). But the rank must consider the first n values set on the slider + the values of the Corporations of a group of Corporations I defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Cor1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;Cor2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;Cor3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;Cor4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;Cor5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;Cor6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;Cor7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;Cor8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;Cor9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;Cor10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13.3333px;"&gt;If the Slider is set to 5, and the group of Corporations I'm trying to show considers Corporations 7 and 9, it should be like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Cor1&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Cor2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Cor3&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Cor4&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Cor5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Cor7&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Cor9&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;But this could nof influence the position of each Corporation in the Rank. Ok, this works like a charm in the Rank expression I made, but if I use that same expression to verify where there sould be Sales (setting to null() when not applicable), QlikView brakes the Others line, not showing the value that should be in it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;What I need for now is a way to count these Corporations outside the Slider value to set in the Dimension Limit, where the Others row works properly. Or a better way to do this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;This issue should work with tables and bar/line charts.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I'm attaching a qvw file and the xls I used to develop this test case.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Regarding the script, the real case uses a very big fact table with multiple considerations for the rank for each period and dimension, so I do't think that would be a solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 13:07:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-Values-from-Rank-gt-n/m-p/1015705#M344240</guid>
      <dc:creator>kira_whopper</dc:creator>
      <dc:date>2016-03-17T13:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Count of Values from Rank &gt; n</title>
      <link>https://community.qlik.com/t5/QlikView/Count-of-Values-from-Rank-gt-n/m-p/1015706#M344241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Managed to do it with a calculated dimension, instead of Corporation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(aggr(rank(TOTAL sum(Value)), Corporation) &amp;lt;= 10 OR Corporation = 'Corp7' OR Corporation = 'Corp9', aggr(rank(TOTAL sum(Value)), Corporation), 'Others')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, for the sorting to don´t be messed up, used this ascending:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(aggr(rank(TOTAL sum(Value)), Corporation) &amp;lt;= 10 OR Corporation = 'Corp20' OR Corporation = 'Corp10', aggr(rank(TOTAL sum(Value)), Corporation), 9999)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where the 9999 would be a safe limit that wouldn't be reached by the slider.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached file with solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 17:31:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-of-Values-from-Rank-gt-n/m-p/1015706#M344241</guid>
      <dc:creator>kira_whopper</dc:creator>
      <dc:date>2016-03-17T17:31:26Z</dc:date>
    </item>
  </channel>
</rss>

