Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rcandeo
Creator III
Creator III

Minimum with Ranking

In this example, I neeed to find the minimum value considering ony the 10 bigger values.

So where it shows 990, I need to be 1100 as this is the 10th bigger value

My actual expression is:

=Min(ALL Aggr(Sum({<Name=>} Value),Name))

Thank You

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Min(ALL Aggr(Sum({<Name = {"=Rank(Sum({$<Category=>}Value)) < 11"}, Category>} Value),Name))


Capture.PNG

View solution in original post

7 Replies
sunny_talwar

May be this:

=Min(ALL Aggr(Sum({<Name = {"=Rank(Sum(Value)) < 11"}>} Value),Name))

sunny_talwar

Why are you using ALL? This is something which will be discontinued in future version. If this is something you use in a text box, you might just need this

=Min({1} Aggr(Sum({<Name = {"=Rank(Sum(Value)) < 11"}>} Value),Name))

or this in chart

=Min({1} TOTAL Aggr(Sum({<Name = {"=Rank(Sum(Value)) < 11"}>} Value),Name))

rcandeo
Creator III
Creator III
Author

Unfortunatelly none of these options worked as expected.

I need to have the option to select one of this names and the results cannot change, but they are being changed.

See qvw attached please?

sunny_talwar

This?

=Min(ALL Aggr(Sum({<Name = {"=Rank(Sum({1}Value)) < 11"}>} Value),Name))


Capture.PNG

rcandeo
Creator III
Creator III
Author

almost there. I am sending qvw again with another field - Category. My intention is that min value continue being the same, no matter if I select category A or B. Can you help me with this?

maxmin.jpg

sunny_talwar

Try this:

=Min(ALL Aggr(Sum({<Name = {"=Rank(Sum({$<Category=>}Value)) < 11"}, Category>} Value),Name))


Capture.PNG

rcandeo
Creator III
Creator III
Author

Perfect. Just to complete the sentence to be independent from selections os Name and Category:

=Min(ALL Aggr(Sum({<Name = {"=Rank(Sum({$<Name,Category=>}Value)) < 11"},Category>} Value),Name))