Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
christian77
Partner - Specialist
Partner - Specialist

RANK FUNCTION NOT WORKING

Hi.

In the help menú says that Rank funcktion returns an average if the 2nd parameter is set to 2.

RANK(SUM(VALUE),2)

But it doesn't.

When I Rank a NAME, it does it exactly backwards.

I've attached the example.

Thanks.

9 Replies
MK_QSL
MVP
MVP

2nd Table ... Just Remove ID from Dimension,, you will get your result..it is not working because of having two dimension.... It is comparing sum(VALUE) wrt ID and NAME both

Last Table Rank(Name)... Here name starting with Z should be Ranked first... Rank works from Higher to Lower...

so ZYX..A     same as 100 ,90 , 80, 70.. Higher in the list, lower the rank..

christian77
Partner - Specialist
Partner - Specialist
Author

Hi.

Thanks for your answer.

2nd table Works if TOTAL modifier is placed. Otherwise Rank would be only for one column.

3rd table. I don't have that average. That must be a bug.

4th table. You are right. The highest is the last. I hadn't thought it that way.

If I want to get the inverse, what do I do?

RANK(1/RANK(NAME)) DOES NOT WORK

NoOfRows(TOTAL)-RANK(NAME)+1 Works, woof.

I still need that average to be working. Table 3

christian77
Partner - Specialist
Partner - Specialist
Author

The workaround.

use subfield function and rangeaverage

rangeavg(

subfield(Rank(funktion),'-',1)

,

subfield(Rank(funktion),'-',2)

)

It solves it but it is a big ÑAPA.

Average mode using 2nd parameter = 2 should be working fine, but it does not.

MK_QSL
MVP
MVP

Yes...

2nd Table if you use TOTAL qualifier, it will ignore the number of dimensions used in your table.

3rd Table use expression as = NUM(Rank(TOTAL SUM(VALUE),2))

4th is already solved....for reverse rank.use as below.... Max(TOTAL Aggr(RANK(NAME),NAME))-Rank(NAME,4)+1

nizamsha
Specialist II
Specialist II

Paste in ur expression

Aggr( RANK(SUM(VALUE),2),ID)

in the number tab check this expression format as number then u will get what u want 10-12 as 11 and 16-17 as 16.5

nizamsha
Specialist II
Specialist II

Have a Look at This File

christian77
Partner - Specialist
Partner - Specialist
Author

That's what i want.

Good. Average to number. Good!!!!

MK_QSL
MVP
MVP

Only helpful answer?

nizamsha
Specialist II
Specialist II

my solution will excatly work for u did u try that one