# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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?

1 Solution

Accepted Solutions
Not applicable

## max of sum by a field

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

5 Replies
Not applicable

## max of sum by a field

Hi

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

JJ

Not applicable

## max of sum by a field

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

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

Not applicable

## max of sum by a field

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

## max of sum by a field

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

## max of sum by a field

Perfect, that was it 🙂 Thanks for your help,

Oliver