<?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: Creating a ranking with Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-a-ranking-with-Script/m-p/1708284#M724610</link>
    <description>&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;It's working perfeclty&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jun 2020 16:27:48 GMT</pubDate>
    <dc:creator>brunolelli87</dc:creator>
    <dc:date>2020-06-04T16:27:48Z</dc:date>
    <item>
      <title>Creating a ranking with Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-ranking-with-Script/m-p/1708019#M724608</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;I'm trying to create a ranking with the following script:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Valendo:
Load
KKEY, 
[P/L],
[ROE]
Resident Final;

Join (Valendo)
Load
KKEY,
STCK3,
DVPG
Resident Cotações;

TabelaComparacao:
noconcatenate Load
KKEY,
[P/L],
[ROE],
STCK3,
DVPG
Resident Valendo;
Drop Table Valendo;


TabelaPL:
Load 
STCK3,
[P/L] as [P/L4],
DVPG  as DVPG4,

AutoNumber([P/L], DVPG) as RankPL
Resident TabelaComparacao Order By DVPG, [P/L] desc;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's working good, and I'm getting the right information back as you can see below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Result1.png" style="width: 406px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/34912i80C2123F2992873D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Result1.png" alt="Result1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now I'm trying to create another table, to rank the field ROE,&amp;nbsp; with the same index DVPG.&lt;/P&gt;&lt;P&gt;How can I do that?&lt;BR /&gt;It seems the counter is not being reset.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-ranking-with-Script/m-p/1708019#M724608</guid>
      <dc:creator>brunolelli87</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a ranking with Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-ranking-with-Script/m-p/1708174#M724609</link>
      <description>&lt;P&gt;Try this may be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Valendo:
LOAD KKEY, 
     [P/L],
     [ROE]
Resident Final;

Join (Valendo)
LOAD KKEY,
     STCK3,
     DVPG
Resident Cotações;

TabelaComparacao:
LOAD KKEY,
     [P/L],
     [ROE],
     STCK3,
     DVPG,
     If(DVPG = Previous(DVPG), RangeSum(Peek('RankPL'), 1), 1) as RankPL
Resident Valendo
Order By DVPG, [P/L] desc;

DROP Table Valendo;

FinalTabelaComparacao:
LOAD *,
     If(DVPG = Previous(DVPG), RangeSum(Peek('RankPL'), 1), 1) as RankROE
Resident TabelaComparacao
Order By DVPG, [ROE] desc;

DROP Table TabelaComparacao;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 04 Jun 2020 12:53:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-ranking-with-Script/m-p/1708174#M724609</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-06-04T12:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a ranking with Script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-ranking-with-Script/m-p/1708284#M724610</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;It's working perfeclty&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 16:27:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-ranking-with-Script/m-p/1708284#M724610</guid>
      <dc:creator>brunolelli87</dc:creator>
      <dc:date>2020-06-04T16:27:48Z</dc:date>
    </item>
  </channel>
</rss>

