Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
fashid
Specialist
Specialist

how to get the consecutive rank when there are same ranks in column using rank function

Hi,

I have  a table which has a rank function in it .

two rows have the same rank 8.

After that there is rank 10 but i need that to be 9 and the last one to be 10.

Could it be possible.


Regards,

Nadeem

Untitled.png

1 Solution

Accepted Solutions
Anonymous
Not applicable

It is possible but quite cumbersome...  Attached.  Maybe you find a better way...

View solution in original post

16 Replies
Anonymous
Not applicable

See attached

sunny_talwar

Michael‌‌ I think he is looking for this:

BranchTotal ScoreRank
PUN441
MUM402
BLR363
CAL354
DEL315
CHN286
GOA267
AHD258
HYD258
COC159
CHD010

Is this possible? Tried it doing using different options with Rank but couldn't get it to work.

Sunny

Anonymous
Not applicable

It is possible but quite cumbersome...  Attached.  Maybe you find a better way...

sunny_talwar

May be this if doing in in the script is okay

Temp:

LOAD * INLINE [

    Branch, Total Score

    PUN, 44

    MUM, 40

    BLR, 36

    CAL, 35

    DEL, 31

    CHN, 28

    GOA, 26

    AHD, 25

    HYD, 25

    COC, 15

    CHD, 0

];

Table:

NoConcatenate

LOAD *

Resident Temp

Order By [Total Score] desc;

Join (Table)

LOAD Distinct [Total Score],

  AutoNumber([Total Score]) as Rank

Resident Table;

DROP Tables Temp;

nagaiank
Specialist III
Specialist III

The following expression in Michael's solution seems to give the desired result.

RowNo(total)-

  rangesum(above(total

  if(num(rank(total Score,4))=above(num(rank(total Score,4))),1,0),

  0,RowNo(total)))

fashid
Specialist
Specialist
Author

Yes Sunny i am looking for the same output

fashid
Specialist
Specialist
Author

Hi Michael,

Thanks for replying .

You example is giving me 9th rank for HYD . I want AHD and HYD to be both at the same rank that is 8th.

The 9th rank should be given to COH.

I find this very weird in qlikview .

Regards

Nadeem

sunny_talwar

Did you try the following script?

Temp:

LOAD * INLINE [

    Branch, Total Score

    PUN, 44

    MUM, 40

    BLR, 36

    CAL, 35

    DEL, 31

    CHN, 28

    GOA, 26

    AHD, 25

    HYD, 25

    COC, 15

    CHD, 0

];

Table:

NoConcatenate

LOAD *

Resident Temp

Order By [Total Score] desc;

Join (Table)

LOAD Distinct [Total Score],

  AutoNumber([Total Score]) as Rank

Resident Table;

DROP Tables Temp;

fashid
Specialist
Specialist
Author

I cannot do this way because the scores are calculated in front end itself