<?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: Rank with subtotals in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948733#M326566</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User will enter only till 15.. So need to create the 15 expression. I think it will be more complex. But I appreciate for giving your time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Aug 2015 09:39:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-08-19T09:39:08Z</dc:date>
    <item>
      <title>Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948720#M326553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing the issue in creating Straight table with Rank. I have products and in front end I am having input box to show ranks dynamically. I am able to achieve the dynamic ranking , but I am not able to achieve below format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say for Top 5 Product I want to achieve below format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Product&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; Sales&lt;/P&gt;&lt;P&gt;1&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; 50&lt;/P&gt;&lt;P&gt;2&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; 40&lt;/P&gt;&lt;P&gt;3&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; 30&lt;/P&gt;&lt;P&gt;4&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; 20&lt;/P&gt;&lt;P&gt;5&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; 10&lt;/P&gt;&lt;P&gt;Sub Total Top 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 150&lt;/P&gt;&lt;P&gt;Others&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; 100&lt;/P&gt;&lt;P&gt;Grand Total&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; 250&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using value list but it's not working as Top Product is dynamic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest it's urgent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 19:20:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948720#M326553</guid>
      <dc:creator />
      <dc:date>2015-08-18T19:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948721#M326554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let try with Dimension Limits on straight table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 20:05:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948721#M326554</guid>
      <dc:creator />
      <dc:date>2015-08-18T20:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948722#M326555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please use this application.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 01:55:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948722#M326555</guid>
      <dc:creator>qlikviewwizard</dc:creator>
      <dc:date>2015-08-19T01:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948723#M326556</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/96544"&gt;gwassenaar&lt;/A&gt;‌ &lt;A href="https://community.qlik.com/qlik-users/15823"&gt;swuehl&lt;/A&gt;‌ &lt;A href="https://community.qlik.com/qlik-users/88778"&gt;MayilVahanan&lt;/A&gt;‌ &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;sunindia&lt;/A&gt;‌&amp;nbsp; Please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 05:35:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948723#M326556</guid>
      <dc:creator />
      <dc:date>2015-08-19T05:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948724#M326557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not getting sub total for Top 5. This I am already able to achieve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 05:36:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948724#M326557</guid>
      <dc:creator />
      <dc:date>2015-08-19T05:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948725#M326558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PFA&amp;nbsp; solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 06:41:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948725#M326558</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2015-08-19T06:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948726#M326559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be not the best way to do it, but gets the result you are looking for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="96400" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/96400_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension: &lt;STRONG&gt;=ValueList($(vList))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where vList&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Concat(DISTINCT {&amp;lt;Product = {"=Rank(Sum(Sales)) &amp;lt;= 5"}&amp;gt;} Chr(39) &amp;amp; Product &amp;amp; Chr(39), ', ') &amp;amp; ', ' &amp;amp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Chr(39) &amp;amp; 'Subtotal Top5' &amp;amp; Chr(39) &amp;amp; ', ' &amp;amp; Chr(39) &amp;amp; 'Others' &amp;amp; Chr(39)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;Expression:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=If(Dimensionality() = 0, Sum(Aggr(Avg(Sales), Product)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 1"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 1"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 2"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 2"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 3"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 3"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 4"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 4"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 5"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 5"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = 'Subtotal Top5', Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) &amp;lt;= 5"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = 'Others', Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) &amp;gt; 5"}&amp;gt;}Sales)))))))))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 06:41:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948726#M326559</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-19T06:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948727#M326560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. But I think you have individually created expression using Value list.. In my case I have inputbox for Rank so now it's top 5 , but when user will input 10. it should be top 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it is clear now&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 07:04:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948727#M326560</guid>
      <dc:creator />
      <dc:date>2015-08-19T07:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948728#M326561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there is a upper limit to the rank a user can enter, we can still make the above dynamic, but the expression will be huge. Not sure if there is another way to do it, may be somebody else can help you out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 07:13:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948728#M326561</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-19T07:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948729#M326562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be you can try something like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create inline Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Measure:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * Inline [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Measure&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3 ]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create straight Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dimension&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Pick(Measure,Product,'Sub Total Top $(vTop)','Others')&amp;nbsp;&amp;nbsp; where &lt;STRONG style="font-size: 13.3333330154419px;"&gt;&lt;EM&gt;vTop&lt;/EM&gt; is your variable&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expression:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Pick(Measure,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Product={"=rank(sum(Sales),4)&amp;lt;=$(vTop)"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Product={"=rank(sum(Sales),4)&amp;lt;=$(vTop)"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Product={"=rank(sum(Sales),4)&amp;gt;$(vTop)"}&amp;gt;}Sales))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also see some settings in Sort Tab of Chart and Text format of Dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 07:43:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948729#M326562</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2015-08-19T07:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948730#M326563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kush,&lt;/P&gt;&lt;P&gt;Thanks a lot for this. This is very close to what I need. But only one prob. , Grand Total is wrong. Can you help me to correct it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 07:50:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948730#M326563</guid>
      <dc:creator />
      <dc:date>2015-08-19T07:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948731#M326564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see the attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 07:58:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948731#M326564</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2015-08-19T07:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948732#M326565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is little more dynamic (I have added the expression for up to 25 rank) you can add more if the user enter more then 25:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=If(Dimensionality() = 0, Sum(Aggr(Avg(Sales), Product)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 1"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 1"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 2"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 2"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 3"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 3"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 4"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 4"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 5"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 5"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 6"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 6"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 7"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 7"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 8"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 8"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 9"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 9"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 10"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 10"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 11"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 11"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 12"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 12"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 13"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 13"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 14"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 14"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 15"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 15"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 16"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 16"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 17"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 17"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 18"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 18"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 19"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 19"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 20"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 20"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 21"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 21"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 22"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 22"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 23"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 23"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 24"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 24"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 25"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 25"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = 'Subtotal Top ' &amp;amp; vRank, Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) &amp;lt;= vRank"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = 'Others', Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) &amp;gt; vRank"}&amp;gt;}Sales)))))))))))))))))))))))))))))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output when user enter 5:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="96406" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/96406_Capture.PNG" style="height: 145px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output when user enters 20:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="96410" alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/96410_Capture.PNG" style="height: 318px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot see Kush's solution which might be better, but just giving you another solution to give you food for thought &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 09:09:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948732#M326565</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-19T09:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948733#M326566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;User will enter only till 15.. So need to create the 15 expression. I think it will be more complex. But I appreciate for giving your time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 09:39:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948733#M326566</guid>
      <dc:creator />
      <dc:date>2015-08-19T09:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948734#M326567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need just one expression. For 15 you will need this one big expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=If(Dimensionality() = 0, Sum(Aggr(Avg(Sales), Product)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 1"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 1"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 2"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 2"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 3"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 3"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 4"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 4"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 5"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 5"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 6"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 6"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 7"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 7"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 8"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 8"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 9"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 9"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 10"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 10"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 11"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 11"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 12"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 12"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 13"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 13"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 14"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 14"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = Only({&amp;lt;Product = {"=Rank(Sum(Sales)) = 15"}&amp;gt;}Product), Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) = 15"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = 'Subtotal Top ' &amp;amp; vRank, Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) &amp;lt;= vRank"}&amp;gt;}Sales),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(ValueList($(vList)) = 'Others', Sum({&amp;lt;Product = {"=Rank(Sum(Sales)) &amp;gt; vRank"}&amp;gt;}Sales)))))))))))))))))))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 09:42:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948734#M326567</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-19T09:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rank with subtotals</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948735#M326568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having given you another option, I would recommend going for the best solution &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 09:44:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-with-subtotals/m-p/948735#M326568</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-19T09:44:25Z</dc:date>
    </item>
  </channel>
</rss>

