<?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: Summing top X ranked items in chart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556112#M481731</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out this blog article:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.naturalsynergies.com/q-tip-5-show-top-performers-common-but-not-too-trivial/" title="http://www.naturalsynergies.com/q-tip-5-show-top-performers-common-but-not-too-trivial/"&gt;QlikView Blog Q-Tip #5 – Show Top Performers. Common but not too trivial. | Natural Synergies&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enjoy!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.masterssummit.com/"&gt;www.masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Sep 2013 22:47:49 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2013-09-23T22:47:49Z</dc:date>
    <item>
      <title>Summing top X ranked items in chart</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556109#M481728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have searched the community for an answer for this, but other posted solutions do not seem to work for my case.&amp;nbsp; I have the following input.&amp;nbsp; &lt;SPAN style="color: #808080;"&gt;&lt;EM&gt;Note:&amp;nbsp; My actual data are spread out across multiple tables using a hash as a key to link customers to projects and bids.&amp;nbsp; They are too big to JOIN in the script, but QV handles the tables nicely without join.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;INLINE&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[&lt;BR /&gt; Customer, Project, Exclusive, Bid&lt;BR /&gt; A, foo, 1, 40&lt;BR /&gt; B, foo, 0, 1&lt;BR /&gt; C, foo, 0, 2&lt;BR /&gt; D, foo, 0, 4&lt;BR /&gt; E, foo, 0, 7&lt;BR /&gt; F, foo, 0, 10&lt;BR /&gt; A, bar, 0, 10&lt;BR /&gt; B, bar, 0, 4&lt;BR /&gt; A, ded, 1, 30&lt;BR /&gt; B, ded, 1, 15&lt;BR /&gt; C, ded, 0, 5&lt;BR /&gt; D, ded, 0, 5&lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want my output to have the following columns:&lt;/P&gt;&lt;P&gt;Project = project dimension&lt;/P&gt;&lt;P&gt;SharedSum = This is the sum of the top 4 customer bids with Exclusive = 0 associated with the project on that row.&amp;nbsp; For example, with project "foo", the top 4 would be customer F (bid = 10), E (bid = 7), D (4), C(2).&amp;nbsp; The sum would therefore be 10+7+4+2 = 23.&amp;nbsp; The resulting table will have these values.&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="132"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="17" width="64"&gt;Project&lt;/TD&gt;&lt;TD width="68"&gt;ShareSum&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;bar&lt;/TD&gt;&lt;TD align="right"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;ded&lt;/TD&gt;&lt;TD align="right"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;foo&lt;/TD&gt;&lt;TD align="right"&gt;23&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I cannot get my ShareSum calculation to work properly.&amp;nbsp; Here is what I have, which doesn't work:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;rank&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;( { &amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Exclusive&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={0} &amp;gt; } &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Bid&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)) &amp;lt;= 4,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;( { &amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Exclusive&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={0} &amp;gt; } &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Bid&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt; ), &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Customer&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Correct answer with help from &lt;A href="https://community.qlik.com/qlik-users/2310"&gt;Oleg Troyansky&lt;/A&gt;'s comment/blog post:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;(&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;rank&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;( { &amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;Exclusive&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;={0} &amp;gt; } &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;Bid&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;),4) &amp;lt;= 4,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;( { &amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;Exclusive&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;={0} &amp;gt; } &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;Bid&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt;), &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;Customer&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2013 16:17:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556109#M481728</guid>
      <dc:creator />
      <dc:date>2013-09-23T16:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Summing top X ranked items in chart</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556110#M481729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can change the script you can try the below code. It will create a Rank column for each Project and each Exclusive flag. So all you have to do is use set analysis on the front end. No need of Aggr/If.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG.png" class="jive-image" height="167" src="https://community.qlik.com/legacyfs/online/46834_Capture.PNG.png" style="width: 382.7699115044248px; height: 167px;" width="383" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fact:&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;,RecNo() as ID&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;&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;&amp;nbsp;&amp;nbsp; // Create ID Field&lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;Customer, Project, Exclusive, Bid&lt;/P&gt;&lt;P&gt;A, foo, 1, 40&lt;/P&gt;&lt;P&gt;B, foo, 0, 1&lt;/P&gt;&lt;P&gt;C, foo, 0, 2&lt;/P&gt;&lt;P&gt;D, foo, 0, 4&lt;/P&gt;&lt;P&gt;E, foo, 0, 7&lt;/P&gt;&lt;P&gt;F, foo, 0, 10&lt;/P&gt;&lt;P&gt;A, bar, 0, 10&lt;/P&gt;&lt;P&gt;B, bar, 0, 4&lt;/P&gt;&lt;P&gt;A, ded, 1, 30&lt;/P&gt;&lt;P&gt;B, ded, 1, 15&lt;/P&gt;&lt;P&gt;C, ded, 0, 5&lt;/P&gt;&lt;P&gt;D, ded, 0, 5&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Join Rank to Fact table&lt;/P&gt;&lt;P&gt;LEFT JOIN (Fact)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;,if(Project=Previous(Project),peek(Rank)+1,1) as Rank&lt;/P&gt;&lt;P&gt;RESIDENT Fact&lt;/P&gt;&lt;P&gt;ORDER BY Exclusive,Project, Bid DESC&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2013 20:56:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556110#M481729</guid>
      <dc:creator>manas_bn</dc:creator>
      <dc:date>2013-09-23T20:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Summing top X ranked items in chart</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556111#M481730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manas, that is an elegant solution.&amp;nbsp; But I may have oversimplified my question. Your solution would work if my data were in a single table.&amp;nbsp; My data are in separate tables, one with Customer and Project, and another with Customer and Price, linked by a hash key (it's actually even more complicated than that, but I'm trying to keep it simple for this example).&amp;nbsp; These tables are extremely large, and my attempts at joining them in the script crash QlikView.&amp;nbsp; However, QV handles the data nicely as separate tables in the reports.&amp;nbsp; This forces me to keep them as separate tables joined by a hash key, and perform the Aggr/rank in the report itself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2013 21:18:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556111#M481730</guid>
      <dc:creator />
      <dc:date>2013-09-23T21:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Summing top X ranked items in chart</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556112#M481731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out this blog article:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.naturalsynergies.com/q-tip-5-show-top-performers-common-but-not-too-trivial/" title="http://www.naturalsynergies.com/q-tip-5-show-top-performers-common-but-not-too-trivial/"&gt;QlikView Blog Q-Tip #5 – Show Top Performers. Common but not too trivial. | Natural Synergies&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enjoy!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.masterssummit.com/"&gt;www.masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2013 22:47:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556112#M481731</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2013-09-23T22:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Summing top X ranked items in chart</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556113#M481732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see the attached one&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 05:21:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556113#M481732</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2013-09-24T05:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Summing top X ranked items in chart</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556114#M481733</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/2310"&gt;Oleg Troyansky&lt;/A&gt; By golly! After reading your blog post and trying various permutations, I think I got it to work!&amp;nbsp; I applied to to my *real* data set and so far everything looks correct.&amp;nbsp; I still have a little more auditing to do, though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I ended up with for my expression (not dimension):&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;rank&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;( { &amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Exclusive&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={0} &amp;gt; } &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Bid&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;),4) &amp;lt;= 4,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;( { &amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Exclusive&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={0} &amp;gt; } &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Bid&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;BR /&gt; ), &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Customer&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I was very close with my original expression; I just needed to have all my dimensions identified in the Aggr function.&amp;nbsp; So just Aggr by Customer was not enough, I had to also include Project to get the correct values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading up on the "4" in the Rank function, I'm still not clear what it is actually doing, but the calculation does not work without it.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;4 - Lowest rank on first row, then incremented by one for each row &lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I might also look into optimizing my data to have precalculated ranked values in a table somewhere, but that might force me to do it on the database side.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 14:57:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556114#M481733</guid>
      <dc:creator />
      <dc:date>2013-09-24T14:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Summing top X ranked items in chart</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556115#M481734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Reading up on the "4" in the Rank function, I'm still not clear what it is actually doing, but the calculation does not work without it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE class="jive-quote"&gt;
&lt;P&gt;4 - Lowest rank on first row, then incremented by one for each row &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chadd - the parameter 4 makes sure that each element gets a unique rank, even if the value is the same. For example, if the first 3 projects have an identical value = 1,000 you could give them all Rank = 1, or Rank = "1-3", or rank each one of them with a unique number 1, 2, 3. The parameter "4" means the later, - each entry is ranked with a unique number. Otherwise, you are running into a risk of getting more than N top entries (by accident, also 4 in your example)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 21:16:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-top-X-ranked-items-in-chart/m-p/556115#M481734</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2013-09-24T21:16:08Z</dc:date>
    </item>
  </channel>
</rss>

