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

rank function showing incorrect rank after selection

Hi,

I have chart with rank function which shows consecutive ranks .

The Problem is that the rank changes after selecting a branch.

I have already tried the 1 approach inside the set analysis for  variables.

The rank is calculated on the basis on the first column.

I have used the following expression for RANK in my chart

=RowNo(total) -  rangesum(above(total

  if(num(rank(total Column(1),1))=above(num(rank(total Column(1),1))),1,0),

  0,RowNo(total))).

Regards,

Nadeem

6 Replies
marcus_sommer

Why didn't you use a normal rank-function like: rank(sum({1} value))? References to other columns like column(x) or using from the expression-label return a kind of reflection which couldn't be (always) used in complex calculations with total or aggr.

- Marcus

fashid
Specialist
Specialist
Author

Hi Marcus,

Because i wanted consecutive ranks .Hence i did not use the simple rank function.

sunny_talwar

Marcus‌, he was unable to use straight rank function because of reasons discussed in this thread how to get the consecutive rank when there are same ranks in column using rank function

marcus_sommer

Ok. I understand. To be independent from selections you will need to fix the rank-expression by using a direct aggregation-function or you fixed the expression from the other column. If you could use a sorting on your expression a simple rowno() will also return a consecutive rank.

Maybe an alternatively could be to detach the chart or the use from alternate states.

- Marcus

fashid
Specialist
Specialist
Author

Tried it but did not work

marcus_sommer

Normally it should work. But at the moment I haven't time to look deeper in your case - maybe my "dirty" solution from here Re: Overall ranking within a table containing several dimensions could work for you or give you some new hints.

-  Marcus