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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
anagharao
Creator II
Creator II

Rank () - Not working as expected

Hi Everyone,

I have a straight table with Employee, Manager, LOB and Amount (spend)details. I am trying to show only the top 10 of the sum amount using the below formula:

SUM({<Employee={"=Rank(Sum([AMOUNT]))<10"}>}Amount)

However this doesn't work. Also if i move the value to 15 or 20 i see all records or some records in the middle skipped.

Thank you for your help

Regards,

Anagha

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Try this expression.

You have entered the "Amount" field in caps. That causes the issue.

SUM({<Employee={"=Rank(Sum([Amount]))<=10"}>}Amount)

View solution in original post

7 Replies
Anil_Babu_Samineni

Like this.

224437.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tamilarasu
Champion
Champion

Try this expression.

You have entered the "Amount" field in caps. That causes the issue.

SUM({<Employee={"=Rank(Sum([Amount]))<=10"}>}Amount)

Chanty4u
MVP
MVP

try this,


Sum({<Employee={'>$(=sum(Amount,10))'}>} amount)


Edited:

tyagishaila
Specialist
Specialist

This expression is giving correct result.

I think you are using field name "AMOUNT" while it is "Amount"

fneumann
Contributor III
Contributor III

As an alternative, you can also put the rank()-function as a dynamic dimension like this:

aggr(if(Rank(Sum([Amount]))<=10, Employee,'Others'),Employee)

In the formular, you just put Sum([Amount])

tyagishaila
Specialist
Specialist

find attached file for solution

effinty2112
Master
Master

Hi Anagho

                    Does this straight table give you what you need?

Employee Sum({$<Employee = {"=Aggr(Rank(Sum(Amount),0,1), Employee) <= 10"}>}Amount)
Amir11321
Ambika8798
Arjun8798
Ait7894
Amit5568
Lekha5487
Ram4987
Airt4984
Rekha4785
Anjan1654