Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
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
Specialist II
Specialist II

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