<?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: Total of Top n ... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497428#M481950</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oli&lt;/P&gt;&lt;P&gt;You are welcome to attach your qvw if you wan't some more help in this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ori&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Sep 2013 08:08:22 GMT</pubDate>
    <dc:creator>orital81</dc:creator>
    <dc:date>2013-09-10T08:08:22Z</dc:date>
    <item>
      <title>Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497425#M481947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Hi&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;I have searched this forum but can not adapt any of the solutions and yield a correct result &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/blush.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;I have created a pivot table to show the top n suppliers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;The Expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;if(aggr(rank(sum({1&amp;lt;[Receipt Year] = {$(vCurrentYear)}&amp;gt; *&amp;lt;[Receipt Month #] = {'&amp;lt;=$(vLastMonth)'}&amp;gt;}[# Currency line value])), [Master&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; supplier no.]) &amp;lt;= 10, MstrSupplierName, null())&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;The Dimension:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;This is held in a variable called &lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt;vCurrentYear_Spend&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sum({1&amp;lt;[Receipt Year] = {$(vCurrentYear)}&amp;gt; *&amp;lt;[Receipt Month #] = {'&amp;lt;=$(vLastMonth)'}&amp;gt;}[# Currency line value])&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;I can calculate the % of Total for &lt;STRONG&gt;ALL&lt;/STRONG&gt; suppliers (&lt;/SPAN&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;this is working correctly).&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =$(vCurrentYear_Spend)/sum({$&amp;lt;[Receipt Year] = {$(vCurrentYear)}&amp;gt;} total [# Currency line value])&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;What I am finding difficult is how to calculate the % of Top 10 because I don't know how to write the formula to sum() the top 10.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;I hope this makes sense...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Oli&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 11:58:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497425#M481947</guid>
      <dc:creator />
      <dc:date>2013-09-09T11:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497426#M481948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you already have the Top N Suppliers Value&lt;/P&gt;&lt;P&gt;You can add another expression with the value of&lt;/P&gt;&lt;P&gt;all suppliers for the specific year AGGR(Sum(Value),[Receipt Year])&lt;/P&gt;&lt;P&gt;Then all you need to do is calculate the Ratio:&lt;/P&gt;&lt;P&gt;TopN Value / Total Value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what you meant?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 12:14:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497426#M481948</guid>
      <dc:creator>orital81</dc:creator>
      <dc:date>2013-09-09T12:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497427#M481949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ori&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&amp;nbsp; As yet I have not managed to get this to work.&amp;nbsp; I think this is my limited knowledge holding me back.&amp;nbsp; I am trying to simply it at the moment by removing the set analysis from the formulas...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oli&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 07:40:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497427#M481949</guid>
      <dc:creator />
      <dc:date>2013-09-10T07:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497428#M481950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oli&lt;/P&gt;&lt;P&gt;You are welcome to attach your qvw if you wan't some more help in this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ori&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 08:08:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497428#M481950</guid>
      <dc:creator>orital81</dc:creator>
      <dc:date>2013-09-10T08:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497429#M481951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ori&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a very simplified example file.&amp;nbsp; I hope none of the complexity I have left out will affect your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again, thank you for your assistance. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 09:09:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497429#M481951</guid>
      <dc:creator />
      <dc:date>2013-09-10T09:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497430#M481952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oli&lt;/P&gt;&lt;P&gt;There is a simple solution,&lt;/P&gt;&lt;P&gt;If you are using straight table you can use the Relative checkbox&lt;/P&gt;&lt;P&gt;which will show you the percentage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See my attachment, I have created a new table on the right&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 09:23:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497430#M481952</guid>
      <dc:creator>orital81</dc:creator>
      <dc:date>2013-09-10T09:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497431#M481953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, you're fast!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Do you know of a way to get this If I am having to use a pivot table instead of the straight version?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am asking because this is currently the case and I am trying to learn as much as possible from my peers for future projects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Oli&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 09:29:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497431#M481953</guid>
      <dc:creator />
      <dc:date>2013-09-10T09:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497432#M481954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 09:34:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497432#M481954</guid>
      <dc:creator>michael_maeuser</dc:creator>
      <dc:date>2013-09-10T09:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497433#M481955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a way to do it with pivot table, but it's a bit more complicated.&lt;/P&gt;&lt;P&gt;Hopefully, I will get to it later on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 09:56:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497433#M481955</guid>
      <dc:creator>orital81</dc:creator>
      <dc:date>2013-09-10T09:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497434#M481956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something?&amp;nbsp; I can not see what you are showing me in the attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is some confusion, I am trying to figure out the formula that would result in the value 1,374,942 (the total of the top 10 suppliers).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oli&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 14:54:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497434#M481956</guid>
      <dc:creator />
      <dc:date>2013-09-11T14:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497435#M481957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ori&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any luck?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this technique will help me quite often, but I have not yet figured it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oli&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 14:56:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497435#M481957</guid>
      <dc:creator />
      <dc:date>2013-09-11T14:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497436#M481958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oli&lt;/P&gt;&lt;P&gt;There is a way to perform this task with pivot table, using a small script addition.&lt;/P&gt;&lt;P&gt;Here is the action plan:&lt;/P&gt;&lt;P&gt;1. Create a table that will hold to sum of top 10 suppliers for every month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; it will have year and &lt;STRONG&gt;total top 10 value&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;2. in the chart expression you will use this value as following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{$&amp;lt;[Receipt Year] = {$(vCurrentYear)}&lt;/SPAN&gt; value) / sum(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{$&amp;lt;[Receipt Year] = {$(vCurrentYear)}&lt;/SPAN&gt; &lt;STRONG&gt;total top 10 value&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to create the new table use something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(If(aggr(rank(sum([Currency line value])), &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;MstrSupplierName&lt;/SPAN&gt;) &amp;lt;= 10, [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Currency line value]&lt;/SPAN&gt;, 0)) as [&lt;STRONG&gt;total top 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value],&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year As YearMonth&lt;/P&gt;&lt;P&gt;Resident YourTable&lt;/P&gt;&lt;P&gt;group by Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im sure there are other good ways to do it, such as using a top 10 flag or you can calculate the top 10 in a variable&lt;/P&gt;&lt;P&gt;but this approach will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know how it goes for you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 18:35:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497436#M481958</guid>
      <dc:creator>orital81</dc:creator>
      <dc:date>2013-09-11T18:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497437#M481959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry here it is&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 07:05:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497437#M481959</guid>
      <dc:creator>michael_maeuser</dc:creator>
      <dc:date>2013-09-12T07:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Total of Top n ...</title>
      <link>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497438#M481960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try with&amp;nbsp; the firstsortedvalue &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 07:17:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Total-of-Top-n/m-p/497438#M481960</guid>
      <dc:creator />
      <dc:date>2013-09-12T07:17:50Z</dc:date>
    </item>
  </channel>
</rss>

