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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
vvvvvvizard
Partner - Specialist
Partner - Specialist

Max client name based on expression

LOAD * Inline [

Client , Tickets

A , 20

b , 20

C , 30

A , 20

D , 5

];

This return the highest number of tickets a client has

=Max(aggr(Sum(Tickets),Client))

Now how do I return the client name with the highest number of tickets in a textbox

15 Replies
sunny_talwar

Strange but what I provided seems to be working okay for me

Capture.PNG

YoussefBelloum
Champion
Champion

didn't work for me, at least with op's sample data

sunny_talwar

Check the sample I have attached below... it did work for me based on OP's sample

YoussefBelloum
Champion
Champion

Actually I don't know if OP re changed his inline or I'm just using his previous sample data, but I'm using this

LOAD * Inline [

Client , Tickets

A , 10

b , 20

C , 30

A , 20

D , 5

];

and with this data, the expression using rank don't work for me

sunny_talwar

He is using

LOAD * Inline [

Client , Tickets

A , 20

b , 20

C , 30

A , 20

D , 5

];

and the reason it doesn't work in your case is because there is a clash for Rank 1... try this with your data because of the clash

=Concat(DISTINCT {<Client = {"=Rank(Sum(Tickets)) = 1"}>}Client, ', ')

YoussefBelloum
Champion
Champion

Understood, was using his previous sample..

Thanks