I have a table like this in the report designer:
Category: 1 2 3 4 Total
Max Amount: x y z c ?
I need to get the total of Max Amount, but expressions will not let me take Sum(Max(amount)), and the add total is disabled for this cell.
The max amount row is an expression that takes the max of each category. The source data has repeated values, so I just take the max. For example:
Category Amount
1 4.6
1 4.6
1 4.6
2 5
3 4
Other columns in the table are different, but amount will be the same so I cannot only select distinct values.
Maybe something like this:
You can also do it like this. If you are using sql server 2005+:
EDIT
If you have a 1000 categories. Then a dynamic pivot would be the best solution. So like this:
Test data
Unique column names
Dynamic pivot