Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
brunolelli87
Creator II
Creator II

Creating 2 Ranks on a script

Dears,

How can I create 2 Different Ranks on a script?

The first should rank the field [P/L] by DVPG, and  STCK, from the highest to the lowest number. Something like this:

=Date(DVPG, 'DD/MM/YY')STCK=[P/L]=RankPL
03/06/20AALR3133,678138483671
03/06/20ALPA464,1429733319212
03/06/20AGRO330,7895420667383
03/06/20ABEV320,4203861473164
03/06/20BBDC49,50681884430675
03/06/20BBDC38,76705711858026
03/06/20BEES38,09842057147257
03/06/20BBAS35,79889087722318
02/06/20AALR3124,685245531131
02/06/20ALPA462,3130306268982
02/06/20AGRO330,7127616981313
02/06/20ABEV319,988861006094

 

The second should rank the field [ROE] by DVPG, and  STCK, from the lowest to the highest number. Something like this:

=Date(DVPG, 'DD/MM/YY')STCKROE=RankROE
03/06/20BBAS35,7988908771
03/06/20BEES38,0984205712
03/06/20BBDC38,7670571193
03/06/20BBDC49,5068188444
03/06/20ABEV320,420386155
03/06/20AGRO330,789542076
03/06/20ALPA464,142973337
03/06/20AALR3133,67813858
02/06/20BBAS35,4768229811
02/06/20BEES37,637203992

 

And at the end of the day, I would like to create a table like this:
As you can see here, for each date and STCK I'll have its rank for PL and ROE.

DVPGSTCKRANK_PLRANK_ROE
03/06/2020AALR318
03/06/2020ALPA427
03/06/2020AGRO336
03/06/2020ABEV345

 

How can I do that?

Please, take a look at my sample data. I was trying to use the AutoNumber([P/L], DVPG) as RankPL and it's working well, but just for the very first table. It's not resetting the counter for the second one.


I'm using QlikView Personal Edition, so please help me with the codes... I can't open any file back.

Thank you so much
Best regards

Bruno Lelli

1 Solution

Accepted Solutions
1 Reply
sunny_talwar

Check out your other post

Creating a ranking with Script