When a calculation uses an aggregate function, it's called an aggregate calculation. You create an aggregate calculation by defining a new calculated field as described in Ho w to Create a Ca lculated Field. The formula will contain one or more aggregate functions. You can easily pick an aggregate function from the Calculation dialog box by selecting Aggregate from the Functions menu as shown below.
These functions are identical to the predefined aggregate functions listed in Ag gre gations.
The aggregate calculation appears with the letters AGG in front of it when it is placed on a shelf.
When you create an aggregate calculation, no further aggregation of the calculation is possible. Therefore, the field’s context menu does not offer any aggregation choices. However, you can disaggregate the field. Refer to Agg regate Calculati ons in a Disaggregated State for more information.
The rules that apply to aggregate calculations are:
For any aggregate calculation, you cannot combine an aggregated value and a disaggregated value. For example, SUM(Price)*[Items] is not a valid expression because SUM(Price) is aggregated and Items is not. However, SUM(Price*Items) and SUM(Price)*SUM(Items) are both valid.
Constant terms in an expression act as aggregated or disaggregated values as appropriate. For example: SUM(Price*7) and SUM(Price)*7 are both valid expressions.
All of the functions can be evaluated on aggregated values. However, the arguments to any given function must either all be aggregated or all disaggregated. For example: MAX(SUM(Sales),Profit) is not a valid expression because Sales is aggregated and Profit is not. However, MAX(SUM(Sales),SUM(Profit)) is a valid expression.
An aggregate calculation is always a measure.
Like predefined aggregations, aggregate calculations are computed correctly for grand totals. Refer to Gr and To tals and Aggregations for more information.