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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

dimension limit in set analysis


hello I know in a chart I can use the dimension limit tab to display the top 5 customers that contribute to sales

my expression is sum(sales)

in the dimension limit I selected show First 5

that's fine but now I want to take the total sales of these top 5 customers to divide it by the total sales

how can I take the total sales of the top 5 to divide it by total sales and display result on a text object?

please advise

I can walk on water when it freezes
Labels (1)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

top 5 sales (1)

=sum({$<Customer={"=rank(sum(Sales),4)<=5"}>}   Sales)

sales (2)

=sum(Sales)     or  =sum({1} Sales)  

in text box

(1) / (2)

View solution in original post

3 Replies
srchilukoori
Specialist
Specialist

Use the following expression:

=100*Sum(Aggr(if(Rank(Sum(Sales)) <=5, Sum(Sales)), Seller))/Sum({1}Sales)

SC

maxgro
MVP
MVP

top 5 sales (1)

=sum({$<Customer={"=rank(sum(Sales),4)<=5"}>}   Sales)

sales (2)

=sum(Sales)     or  =sum({1} Sales)  

in text box

(1) / (2)

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I posted a blog article that describes in detail all the aspects of calculating Top N performers, and some of the pitfalls related to calculated dimensions. Here is the link:

QlikView Blog Q-Tip #5 – Show Top Performers. Common but not too trivial. | Natural Synergies

enjoy!

Oleg Troyansky

Ask me about Qlik Sense Expert Class!