Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

MAX Distinct seler per client?

Hi, everyone,

A have a straight table, with customer in dimension and count of distinct agent who had transactions with this customer, how to find who had the most and what is the number of transactions. Any suggestions?

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Dimension  Customer

Expressions:

COUNT([transaction nr.])

Max(Aggr(SUM([Value $]),Agent,Customer))

FirstSortedValue(Agent,Aggr(-SUM([Value $]),Customer,Agent))

View solution in original post

10 Replies
MK_QSL
MVP
MVP

Max(Aggr(Count(Distinct Transaction),Agent))

and

Max(TOTAL Aggr(Count(Distinct Transaction),Agent))

hic
Former Employee
Former Employee

What about just sorting the Count(distinct Transactions) descending? Then you will get the interesting agent as the top line in the chart. Very visual and intuitive.

HIC

Not applicable
Author

i have these fields:

Customertransaction nr.AgentValue $
john 11A100
john 22B125
john 13B75
john 24B150
john 15A200
john 26B50

i want to get this straight table:

CustomerDistinct AgentNumber of transacionsMax AgentMax agent value of transactions
26--
john 122A300
john 213B325
MK_QSL
MVP
MVP

like this?

Not applicable
Author

Thanks Manish, but could you paste the expresions, because of security issues i can`t download the qvw. Thanks.

MK_QSL
MVP
MVP

Dimension  Customer

Expressions:

COUNT([transaction nr.])

Max(Aggr(SUM([Value $]),Agent,Customer))

FirstSortedValue(Agent,Aggr(-SUM([Value $]),Customer,Agent))

Not applicable
Author

Many thanks it works great

MK_QSL
MVP
MVP

Glad that my answer help you to solve your problem.

oleg_orlov
Creator
Creator

Hi!

But if not only one Agent has the max sum?

You should use someting like that:

Concat(if (Aggr(Rank(Sum(Value)) = 1, Customer, Agent), Agent), ', ')

Regards,

Oleg