Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

max of sum by a field

Hello,

I have the following question:

I have salesman with some sales per month. No I would like to show per month what the maximum sales was of the best salesman.

My guess would have been max(sum(Total <Salesman> Sales)) but that doesn't work.
Attached an example:

I would like to select Region B and then have a max accumelated sales 919000.

Any ideas?

Thanks for your help, Oliver

1 Solution

Accepted Solutions
Not applicable
Author

Hi Oliver,

You are on the right track but you need to add the set statement to each function so try something like this:



max({$<Salesman = >}aggr(sum({$<Salesman = >}Sales),Salesman,Month))


I hope this helps.

Rod



View solution in original post

5 Replies
Not applicable
Author

Hi

You should use AGGR function like this : =max(aggr(sum(Sales),Salesman))

JJ

Not applicable
Author

To make aggr work in the qvw you need to aggregate by Salesman and Month...

max(aggr(sum(Sales),Salesman,Month))


Not applicable
Author

How can I see now the maximum in sales for each month, that the chart will disregard my selection of the salesman?

I basically would like to see in one column the max of sales by the selected salesman and in another column I would like to see the maximum sales for the month. How can I eliminate the salesman selection?

I tried

=



max(aggr(sum({$<Salesman = >} Sales),Salesman, Month))

but it did not work



Not applicable
Author

Hi Oliver,

You are on the right track but you need to add the set statement to each function so try something like this:



max({$<Salesman = >}aggr(sum({$<Salesman = >}Sales),Salesman,Month))


I hope this helps.

Rod



Not applicable
Author

Perfect, that was it 🙂 Thanks for your help,

Oliver