<?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: Ranking in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/2034599#M1222487</link>
    <description>&lt;P&gt;This is, overall, a good solution, but it does not take into account any duplicate values.&lt;/P&gt;
&lt;P&gt;For example, if I have the following sales data:&lt;/P&gt;
&lt;PRE&gt;Salesperson,Sales&lt;BR /&gt;Arlene,100&lt;BR /&gt;Bob,50&lt;BR /&gt;Charlene,80&lt;BR /&gt;David,50&lt;BR /&gt;Erin,95&lt;BR /&gt;Flynn,35&lt;BR /&gt;Gertrude,10&lt;/PRE&gt;
&lt;P&gt;Doing the autonumber will result in rankings that look like this:&lt;/P&gt;
&lt;PRE&gt;Rank Sales Salesperson&lt;BR /&gt;1    100   Arlene&lt;BR /&gt;2     95   Erin&lt;BR /&gt;3     80   Charlene&lt;BR /&gt;4     50   Bob&lt;BR /&gt;4     50   David&lt;BR /&gt;5     35   Flynn&lt;BR /&gt;6     10   Gertrude&lt;/PRE&gt;
&lt;P&gt;That then implies that Flynn is the 5th-best seller, when in reality he's 6th. This isn't generally a big deal with such a small dataset, but with large datasets that have lots of duplicates, the farther down the list you go, the more wrong the rankings get.&lt;/P&gt;
&lt;P&gt;Is there a better solution? Why doesn't Qlik allow the use of Rank in the script?&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2023 18:05:02 GMT</pubDate>
    <dc:creator>FlyingCheesehead</dc:creator>
    <dc:date>2023-02-06T18:05:02Z</dc:date>
    <item>
      <title>Ranking in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/1128261#M631120</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 such data set:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; * &lt;/P&gt;&lt;P&gt;&amp;nbsp; INLINE&lt;/P&gt;&lt;P&gt;&amp;nbsp; [&lt;/P&gt;&lt;P&gt;&amp;nbsp; MONTH, SALESMAN, SALES_VALUE&lt;/P&gt;&lt;P&gt;&amp;nbsp; 201501, BEN, 10&lt;/P&gt;&lt;P&gt;&amp;nbsp; 201501, ANN, 20&lt;/P&gt;&lt;P&gt;&amp;nbsp; 201501, JAC, 5&lt;/P&gt;&lt;P&gt;&amp;nbsp; 201502, BEN, 100&lt;/P&gt;&lt;P&gt;&amp;nbsp; 201502, ANN, 20&lt;/P&gt;&lt;P&gt;&amp;nbsp; 201502, JAC, 50&lt;/P&gt;&lt;P&gt;&amp;nbsp; 201503, BEN, 5&lt;/P&gt;&lt;P&gt;&amp;nbsp; 201503, ANN, 20&lt;/P&gt;&lt;P&gt;&amp;nbsp; 201503, JAC, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to rank the salesman in each month (from the highest sales value). In result I expect the table as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="233"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="15" width="43"&gt;MONTH&lt;/TD&gt;&lt;TD class="xl63" width="57"&gt; SALESMAN&lt;/TD&gt;&lt;TD class="xl63" width="69"&gt; SALES_VALUE&lt;/TD&gt;&lt;TD class="xl63" width="64"&gt;RANKING&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="15"&gt;201501&lt;/TD&gt;&lt;TD class="xl63"&gt; BEN&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;10&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="15"&gt;201501&lt;/TD&gt;&lt;TD class="xl63"&gt; ANN&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;20&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="15"&gt;201501&lt;/TD&gt;&lt;TD class="xl63"&gt; JAC&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="15"&gt;201502&lt;/TD&gt;&lt;TD class="xl63"&gt; BEN&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;100&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="15"&gt;201502&lt;/TD&gt;&lt;TD class="xl63"&gt; ANN&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;20&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="15"&gt;201502&lt;/TD&gt;&lt;TD class="xl63"&gt; JAC&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;50&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="15"&gt;201503&lt;/TD&gt;&lt;TD class="xl63"&gt; BEN&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="15"&gt;201503&lt;/TD&gt;&lt;TD class="xl63"&gt; ANN&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;20&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="15"&gt;201503&lt;/TD&gt;&lt;TD class="xl63"&gt; JAC&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 08:26:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/1128261#M631120</guid>
      <dc:creator>arsenal1983</dc:creator>
      <dc:date>2016-09-01T08:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/1128262#M631121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Group by month / salesman, sum the results, and use row numbers for ranking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better yet, try this resource: &lt;A href="https://community.qlik.com/docs/DOC-13949"&gt;rank in script&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 08:29:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/1128262#M631121</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2016-09-01T08:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/1128263#M631122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try 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; [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; MONTH, SALESMAN, SALES_VALUE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 201501, BEN, 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 201501, ANN, 20&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 201501, JAC, 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 201502, BEN, 100&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 201502, ANN, 20&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 201502, JAC, 50&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 201503, BEN, 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 201503, ANN, 20&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; 201503, JAC, 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&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;&amp;nbsp; AutoNumber(SALES_VALUE, MONTH) 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 MONTH, SALES_VALUE 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;P&gt;&lt;STRONG&gt;&lt;IMG __jive_id="136317" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/136317_Capture.PNG" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 21:35:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/1128263#M631122</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-01T21:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/2034599#M1222487</link>
      <description>&lt;P&gt;This is, overall, a good solution, but it does not take into account any duplicate values.&lt;/P&gt;
&lt;P&gt;For example, if I have the following sales data:&lt;/P&gt;
&lt;PRE&gt;Salesperson,Sales&lt;BR /&gt;Arlene,100&lt;BR /&gt;Bob,50&lt;BR /&gt;Charlene,80&lt;BR /&gt;David,50&lt;BR /&gt;Erin,95&lt;BR /&gt;Flynn,35&lt;BR /&gt;Gertrude,10&lt;/PRE&gt;
&lt;P&gt;Doing the autonumber will result in rankings that look like this:&lt;/P&gt;
&lt;PRE&gt;Rank Sales Salesperson&lt;BR /&gt;1    100   Arlene&lt;BR /&gt;2     95   Erin&lt;BR /&gt;3     80   Charlene&lt;BR /&gt;4     50   Bob&lt;BR /&gt;4     50   David&lt;BR /&gt;5     35   Flynn&lt;BR /&gt;6     10   Gertrude&lt;/PRE&gt;
&lt;P&gt;That then implies that Flynn is the 5th-best seller, when in reality he's 6th. This isn't generally a big deal with such a small dataset, but with large datasets that have lots of duplicates, the farther down the list you go, the more wrong the rankings get.&lt;/P&gt;
&lt;P&gt;Is there a better solution? Why doesn't Qlik allow the use of Rank in the script?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 18:05:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/2034599#M1222487</guid>
      <dc:creator>FlyingCheesehead</dc:creator>
      <dc:date>2023-02-06T18:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/2160288#M1225142</link>
      <description>&lt;P&gt;I think since we now have Window Functions, there should be some capability there. But I am not 100% sure since I have not have the chance to use them in Qlik Sense or QlikView&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 04:14:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/2160288#M1225142</guid>
      <dc:creator>KD_</dc:creator>
      <dc:date>2024-01-11T04:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/2160294#M1225143</link>
      <description>&lt;P&gt;you can use windows function to get rank like this&lt;/P&gt;
&lt;P&gt;load *,window(recno(),'Desc',Sales) as Rank;&lt;BR /&gt;LOAD*INLINE&lt;BR /&gt;[&lt;BR /&gt;Salesperson,Sales&lt;BR /&gt;Arlene,100&lt;BR /&gt;Bob,50&lt;BR /&gt;Charlene,80&lt;BR /&gt;David,50&lt;BR /&gt;Erin,95&lt;BR /&gt;Flynn,35&lt;BR /&gt;Gertrude,10&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ahidhar_0-1704949128653.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/126855i8785829A4101E7BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ahidhar_0-1704949128653.png" alt="Ahidhar_0-1704949128653.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 04:58:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Ranking-in-the-script/m-p/2160294#M1225143</guid>
      <dc:creator>Ahidhar</dc:creator>
      <dc:date>2024-01-11T04:58:16Z</dc:date>
    </item>
  </channel>
</rss>

