Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Group by top N

Hi

I want to create a pie chart with my top 100 customers by sales grouped in a slice and rest customers as another slice. And show the percentage of total sales for the two groups. Let's suppose my data have customer ID and sales amount as two fields. Is there a way to create such as pie with chart expression rather than load script?

I'm trying to create an dimension like this, but it doesn't work...

if(rank(aggr(sum(Sales),[Customer ID]))<100,'Top 100','Other')

Thanks

Yvonne

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

I think just rearrange a bit?

aggr(if(rank(sum(Sales))<=100,'Top 100','Other'),[Customer ID])

View solution in original post

1 Reply
johnw
Champion III
Champion III

I think just rearrange a bit?

aggr(if(rank(sum(Sales))<=100,'Top 100','Other'),[Customer ID])