Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
khanashique
Creator II
Creator II

set expression for ranking in Charts (top5 & bottom5)

Hi Experts,

I need to set expression in Charts and its ranking need to be shown as top5 and bottom5 together...

Untitled.jpg

Thanks,

MAK.

10 Replies
avinashelite

Try like this

=aggr(if(rank(sum(value))<=5 or rank(-sum(value))<=5,DIMENSION),DIMENSION)

khanashique
Creator II
Creator II
Author

Hi Avinash,

I have tried the above expression but it does not work...

Thanks,

MAK.

avinashelite

its working for me ..could share the expression how your trying ?

khanashique
Creator II
Creator II
Author

aggr(if(rank(sum([Sales Target]))<=5 or rank(-sum([Sales Target]))<=5,Customer),Customer)

avinashelite

Your trying this in the expression or dimension?


paste the above expression in the dimension and use sum([Sales Target]) in the expression that should work 

khanashique
Creator II
Creator II
Author

Under Dimension i have used field 'Customer' and the above expression i have used in Expression Editor (Dimension)

Untitled.jpg

avinashelite

na use create a calculated dimension


Dimesnion :

aggr(if(rank(sum([Sales Target]))<=5 or rank(-sum([Sales Target]))<=5,Customer),Customer)


https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/Dimensions/create-calculated-dimen...


Expression

sum([Sales Target])

khanashique
Creator II
Creator II
Author

After applying the above expression in master item as dimension now it gives only top 5 customer, bottom 5 is missing...

khanashique
Creator II
Creator II
Author

Hi Avinash,

Any Luck.? i have tried but i got top 5 customers only....need to get bottom 5 too.

thanks,

MAK.