Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selecting Ascending 5 Values in expression

HI Experts

In my Pivot table, Using a calculated Field Difference

Difference = ([last month Sales] - [Current month Sales])

now i want to choose on top 5 values by Ascending order

Please Suggest

16 Replies
prajapatiamar38
Creator II
Creator II

Hi..

Try like this exp below using aggr():

=IF(Aggr(Rank(Sum(UnitPrice)),DivisionID)<=5,Sum(UnitPrice))

Try to modify this with your expression

Thanks

qlikmsg4u
Specialist
Specialist

It may be work

=Aggr(If(Rank(Sum(Sales)-Above(Sum(Sales)))<=5,Month),Month)

Kushal_Chawda

sum(aggr(if(rank(sum ([last month Sales]) - sum([Current month Sales]),4)<=5,sum ([last month Sales]) - sum([Current month Sales])), Dimension))

Not applicable
Author

HI
I am using a Straight Table

Sorry  Not using a Pivot table

Please Suggest

qlikmsg4u
Specialist
Specialist

Hi John,

Please try above responses, if they doesn't help your query, please post sample app

krishna20
Specialist II
Specialist II

Hi,

why not you go for dimension limits option?

Anonymous
Not applicable
Author

Hi John,

You can restrict Top 5 values in Dimensions Limits tab. Check it once. If it don't work out please upload sample app.

vijetas42
Specialist
Specialist

Hi,

For that calculated expression you can set limit=top 5 from Dimension limit tab

avinashelite

Hi John,

You can try with Dimension limits in the chart properties or use the rank function .