Show TOC
# Calculating Commutative Formulas After Aggregation

## Context

In query monitor, you can use the Query Properties dialog box to specify when a commutative formula is calculated for existing queries.

Commutative formulas are can be calculated before or after aggregation with the same result. By default, the OLAP Engine calculates commutative formulas, which use formula exception aggregation, before aggregation.

A formula calculated before aggregation is part of the generated query report and can be executed with higher system performance than a formula calculated after aggregation (which must be evaluated at runtime). The result of a formula before aggregation can be saved in the OLAP cache. The formula before aggregation is calculated for every data record, which is transferred from the InfoProvider to the OLAP Engine (see statistics event ID 9010: total number transportable records, DBTRANS).

If the formula is calculated after aggregation, then the number of calculations depends on the granularity of the drop-down characteristic and the reference characteristic of the formula exception aggregation.

The use of function Calculate Commutative Formulas After Aggregation can be more efficient if data aggregation is high due to the standard aggregation and exception aggregation. This means that only a few aggregated data records remain, for which the formula needs to be calculated.