Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
marinasbc
Partner - Contributor III
Partner - Contributor III

How many customers make up 80% of sales

I've been trying to use the aggr function to get the number of customers that make up 80% of all sales in a text object - can anyone help?

So far I've got

=count({<Customer={"=(rank(sum({<Customer=>}Amount ),4)-1) / Count({<Customer=>}distinct total Customer) <0.20"}>}DISTINCT Customer)

1 Solution

Accepted Solutions
3 Replies
vishsaggi
Champion III
Champion III

Check here if this can help:

Recipe for a Pareto Analysis

marinasbc
Partner - Contributor III
Partner - Contributor III
Author

Hi Stefan,

That was actually my first try but it didn't work... Or so I thought! It turns out it takes around 10minutes to calculate the text object....

The expression is:

=Count(Distinct

     Aggr(If(Rangesum(Above(Sum({<Customer=>} #Amount)/Sum({<Customer=>}total #Amount),1,RowNo()))<0.8, Customer),

    (Customer,(=Sum({<Customer=>} #Amount),Desc))

    )

)

Thank you for your help