<?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: Adding rank based on 1 dimension in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421980#M612416</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh yes you are right .. that's because I have made it on my own project where only one line exists for each Country/Company&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I take your example Apple is first in Germany where it should be 3rd because of only 1 sale.&lt;/P&gt;&lt;P&gt;What should I do to make your example work ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Oct 2017 14:32:33 GMT</pubDate>
    <dc:creator>fredericvillemi</dc:creator>
    <dc:date>2017-10-24T14:32:33Z</dc:date>
    <item>
      <title>Adding rank based on 1 dimension in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421976#M612412</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;I have a table of sales with two dimensions called Country and Customer and a KPI called Amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to add in this table, for each line, the rank of the customer based on the total amount of this Customer in this Country&lt;/P&gt;&lt;P&gt;For example :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Germany, Google, 10&lt;/P&gt;&lt;P&gt;Germany, Google, 5&lt;/P&gt;&lt;P&gt;Germany, Apple, 1&lt;/P&gt;&lt;P&gt;Germany, Microsoft, 100&lt;/P&gt;&lt;P&gt;Belgium, Microsoft, 50&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;would become :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Germany, Google, 10, rank 2&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Germany, Google, 5, rank 2&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Germany, Apple, 1, rank 3&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Germany, Microsoft, 100, rank 1&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Belgium, Microsoft, 50, rank 1&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;How can I do that in scripting ?&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 11:41:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421976#M612412</guid>
      <dc:creator>fredericvillemi</dc:creator>
      <dc:date>2017-10-24T11:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Adding rank based on 1 dimension in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421977#M612413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country, Company, Sales&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Germany, Google, 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Germany, Google, 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Germany, Apple, 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Germany, Microsoft, 100&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Belgium, Microsoft, 50&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FinalTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Country = Previous(Country), If(Company = Previous(Company), Peek('Rank'), RangeSum(Peek('Rank'), 1)), 1) as Rank&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Order By Country, Company, Sales desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table Table;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 11:47:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421977#M612413</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-24T11:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Adding rank based on 1 dimension in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421978#M612414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your example document&lt;/P&gt;&lt;P&gt;It was almost perfect&lt;/P&gt;&lt;P&gt;I just had to change the ORDER BY to :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Order By Country,&amp;nbsp; Sales desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;in order to have the sales sorted by total (biggest first) and with the rank depending on the Country&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 13:52:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421978#M612414</guid>
      <dc:creator>fredericvillemi</dc:creator>
      <dc:date>2017-10-24T13:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Adding rank based on 1 dimension in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421979#M612415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But then if you sort by Sales, then the same company can be at different places and you may get different rank for them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 14:10:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421979#M612415</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-24T14:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Adding rank based on 1 dimension in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421980#M612416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh yes you are right .. that's because I have made it on my own project where only one line exists for each Country/Company&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I take your example Apple is first in Germany where it should be 3rd because of only 1 sale.&lt;/P&gt;&lt;P&gt;What should I do to make your example work ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 14:32:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421980#M612416</guid>
      <dc:creator>fredericvillemi</dc:creator>
      <dc:date>2017-10-24T14:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adding rank based on 1 dimension in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421981#M612417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be based on total sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country, Company, Sales&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Germany, Google, 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Germany, Google, 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Germany, Apple, 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Germany, Microsoft, 100&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Belgium, Microsoft, 50&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Left Join (Table)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Country,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Company,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum(Sales) as TotalSales&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By Country, Company;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FinalTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Country = Previous(Country), If(Company = Previous(Company), Peek('Rank'), RangeSum(Peek('Rank'), 1)), 1) as Rank&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Order By Country, TotalSales desc, Country;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table Table;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 14:37:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421981#M612417</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-10-24T14:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding rank based on 1 dimension in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421982#M612418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;absolutely excellent !&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 15:12:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-rank-based-on-1-dimension-in-the-script/m-p/1421982#M612418</guid>
      <dc:creator>fredericvillemi</dc:creator>
      <dc:date>2017-10-24T15:12:32Z</dc:date>
    </item>
  </channel>
</rss>

