Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikNAM
Contributor II
Contributor II

Aggr and Rank function to limit the output to a fixed rane

Hi All

Im using the AGGR and Rank function to create a rank for each output value for that dimension

Aggr(Rank(1-count({<[somefield]={'Osomevaluet'}>}A_number)/count(A_number)),$(vDimValue))

the dimensions can be anything from 3 to 10+ values so currently my rank produces the values (1,2,3.....10+) or however many dimension values exist.

I want the rank to automatically limit the values of rank between 1 to 5  one being lowest output value aggregated over the dimension.. i don't want to fix the value if output between a and b value 1., else 2...... is there a dynamic way to calculate a range of rank -1-5 based on the values for that dimension

 

any help appreciated

 

Labels (3)
1 Reply
F_B
Creator III
Creator III

Hi @QlikNAM ,

if I undersood your request right, you could try to adjust your expression like this:

Aggr(If(Rank(1 - count({<[somefield]={'Osomevaluet'}>} A_number) / count(A_number)) <= 5,Rank(1 -count({<[somefield]={'Osomevaluet'}>} A_number) / count(A_number)),5),$(vDimValue))

Hope this helps