Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Chellappan-Pillai
New Contributor

Display the Top Customer for the Category in Straight Table

I need to display the name of the Customer who has the highest SUM(SalesAmount).

image.png

 

Sample Attached.

Labels (1)
1 Solution

Accepted Solutions

Re: Display the Top Customer for the Category in Straight Table

To return the first alphabetically:
Minstring(aggr(If(Rank(SUM(SalesAmount),1,1)=1, Name), EnglishProductName, Name))

To return the last alphabetically:
Maxstring(aggr(If(Rank(SUM(SalesAmount),1,1)=1, Name), EnglishProductName, Name))
3 Replies

Re: Display the Top Customer for the Category in Straight Table

Hi, you can try with:
Concat(aggr(If(Rank(SUM(SalesAmount),1,1)=1, Name), EnglishProductName, Name), ', ')
Chellappan-Pillai
New Contributor

Re: Display the Top Customer for the Category in Straight Table

How to get only the first Customer, If there is multiple Customers with same Sum(SalesAmount)?

Re: Display the Top Customer for the Category in Straight Table

To return the first alphabetically:
Minstring(aggr(If(Rank(SUM(SalesAmount),1,1)=1, Name), EnglishProductName, Name))

To return the last alphabetically:
Maxstring(aggr(If(Rank(SUM(SalesAmount),1,1)=1, Name), EnglishProductName, Name))