<?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 find gap using ranks in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690268#M249936</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manish, thanks for replying..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should have given more description on the requirement... the solution you have given will work only for client that has highest cost rank. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you look at the 2nd example, it needs to find 2nd placed client with most revenue and find out how much more $ to make to reach to 2nd position... so in this case, formula would be - 817.7175449 - 781.8435362=35.8740087... in 3rd example, comparison should be with 3rd placed client based on revenue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, the idea is to check client's cost rank and compare against revenue rank... if client is consuming more costs than the revenue it is generating, then we need to find out how much more $ that client should make to reach to the revenue rank which will be similar to its cost rank... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Aug 2014 13:38:31 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-08-18T13:38:31Z</dc:date>
    <item>
      <title>How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690266#M249934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a requirement to show revenue gap using revenue and cost ranks.. In below example, client h needs to make additional $570.9695744 to reach to no. 1 revenue rank position... formula is - 983.3415781 - 412.3720037 = 570.9695744&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="64575" alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/64575_pastedImage_0.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if a client's revenue rank is already better than its cost rank, then we don't need to calculate revenue gap..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking for any advise to build this type of chart... i don't want to pre calculate as the calculations need to happen at run time based on selected filters...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appreciate any suggestions... thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 22:42:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690266#M249934</guid>
      <dc:creator />
      <dc:date>2014-08-16T22:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690267#M249935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF(rank(sum(revenue),1,1) &amp;gt; rank(sum(cost),1,1), Max(TOTAL Aggr(SUM(revenue),client))-SUM(revenue),NULL())&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Aug 2014 06:21:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690267#M249935</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-08-17T06:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690268#M249936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manish, thanks for replying..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should have given more description on the requirement... the solution you have given will work only for client that has highest cost rank. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you look at the 2nd example, it needs to find 2nd placed client with most revenue and find out how much more $ to make to reach to 2nd position... so in this case, formula would be - 817.7175449 - 781.8435362=35.8740087... in 3rd example, comparison should be with 3rd placed client based on revenue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, the idea is to check client's cost rank and compare against revenue rank... if client is consuming more costs than the revenue it is generating, then we need to find out how much more $ that client should make to reach to the revenue rank which will be similar to its cost rank... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 13:38:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690268#M249936</guid>
      <dc:creator />
      <dc:date>2014-08-18T13:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690269#M249937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry but dont able to catch your requirements.... Can you provide solution in excel file with little more explanation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 13:59:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690269#M249937</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-08-18T13:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690270#M249938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached is the excel version... column F has the formula that shows how the gap is getting calculated... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 14:13:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690270#M249938</guid>
      <dc:creator />
      <dc:date>2014-08-18T14:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690271#M249939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bump!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appreciate any advice...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 09:56:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690271#M249939</guid>
      <dc:creator />
      <dc:date>2014-08-19T09:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690272#M249940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached qvw.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 13:50:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690272#M249940</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-08-22T13:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690273#M249941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gysbert, thanks for the reply..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am actually looking for a dynamic solution... dont want to precalculate the implied revenue gap as that should be recalculated based on some filters.. the example that I uploaded was for illustration purpose of the logic that I am looking for..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appreciate if you could provide any suggestions for dynamically calculating such measure at runtime..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;again, thanks for taking time to look into this issue..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 16:50:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690273#M249941</guid>
      <dc:creator />
      <dc:date>2014-08-22T16:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690274#M249942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look again. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;This time look at the chart expressions instead of at the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Aug 2014 18:53:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690274#M249942</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-08-23T18:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690275#M249943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should have been explicit! The solution works but the expression have hardcoding for 10 clients... my actual client list is in thousands... and filter selections changes the list of applicable clients dynamically...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;correct me If I am missing something that would help me to remove below hardcoding... i liked this idea, but not able to build an expression that would dynamically pick the revenue amount based on cost rank... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(rank(sum(revenue))&amp;gt;rank(sum(cost)),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rangesum(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pick(rank(sum(cost)),&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; &lt;STRONG&gt;$(vMax(1)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMax(2)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMax(3)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMax(4)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMax(5)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMax(6)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMax(7)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMax(8)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMax(9)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vMax(10))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -sum(revenue)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Aug 2014 19:42:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690275#M249943</guid>
      <dc:creator />
      <dc:date>2014-08-23T19:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690276#M249944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can generate that too if you like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(rank(sum(revenue))&amp;gt;rank(sum(cost)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; rangesum(&lt;/P&gt;&lt;P&gt;&amp;nbsp; pick(rank(sum(cost)),&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; $(=concat( 'max(total aggr(sum(revenue),client),' &amp;amp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; num(ValueLoop(1,GetPossibleCount(client)),'00') &amp;amp; ')' &amp;amp;chr(10) ,',' ))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; -sum(revenue)&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 09:24:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690276#M249944</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-08-25T09:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to find gap using ranks</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690277#M249945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Gysbert! the solution works fine!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my only concern is performance... for more then 1000 clients, it takes a while to calculate... am thinking of adding a condition to show chart data only when applicable list of clients is below 1000... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks again... really appreciate your help with this... !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 02:26:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-find-gap-using-ranks/m-p/690277#M249945</guid>
      <dc:creator />
      <dc:date>2014-08-26T02:26:50Z</dc:date>
    </item>
  </channel>
</rss>

