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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get Top Customer Name based on Sales

Hello Community,

I am trying to display the top result from Customer field based on maximum value in Sales field; in this case (refer below table), I want to display Customer "XYZ" in a text box. How can I achieve this?

Also Note: Below Values are dynamic and will change

CustomerSales
ABC30
XYZ100
QWE25
ASD20
OPL20

Thanks,

Labels (1)
1 Solution

Accepted Solutions
fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

Try this in the text Object:

=Concat({<Sales={'$(=Max(Sales))'}>}Customer, ',')

View solution in original post

6 Replies
fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

Try this in the text Object:

=Concat({<Sales={'$(=Max(Sales))'}>}Customer, ',')

buzzy996
Master II
Master II

try tis,

top1.PNG

Not applicable
Author

It worked!! Thanks Federico!!

=only({<sales={'$(=Max(sales))'}>}customer) --> returns only 1 value...

but

=concat({<sales={'$(=Max(sales))'}>}customer) --> return all possible value


eg: if i wanted customers doing low or least sales..then I will use concat in my case since it has two values.


=concat({<sales={'$(=Min(sales))'}>}customer) --> returns ASD,OPL


sushil353
Master II
Master II

Try:

firstsortedvalue(Customer,-Aggr(Sum(Sales),Customer))

fvelascog72
Partner - Specialist
Partner - Specialist

Yes, you are right,

First I posted only, but later I edit post with concat option.

Regards

Not applicable
Author

This works as well!!

firstsortedvalue(Customer,-Aggr(Sum(Sales),Customer))