Total

Syntax

SubTotal(Type: PivotEvaluatorElementType,

Relation: Variant,

Position: PivotTotalPosition)

Parameters

Type. Total calculation method.

Relation. Dimension element by which the calculated total must be obtained. Optional parameter. By default parameter is set to Null.

Position. Total position (by rows/by columns). Optional parameter. The PivotTotalPosition.Default_ default value is position is not specified.

Description

It returns the total value.

Comments

Mandatory condition for method working is enabling of required totals calculation for rows/columns of table. If totals are not calculated, the method returns empty values.

If the Relation parameter is not specified, the function returns the total of the element after which the calculated element is created. As a value of the Relation parameter, it is required to specify element of the dimension, for which a calculated element is created. On specifying the Relation parameter the function returns the grand total calculated by the specified element.

If the Position parameter is not specified, or the value matches the location of created calculated element, the function returns total of the element, for which transformation formula is set. If the value is specified that is opposite to calculated element location (the calculated element is located by columns, and thePivotTotalPosition.Rowsvalue is specified, and vice versa), the function returns subtotal value by rows/columns respectively.

When the Total method is used as a function in formula expressions, take the following into account:

If the total by rows or columns is not calculated, the corresponding function set in the formulas returns empty value.

Example

Formula Result Application
= Total(PivotEvaluatorElementType.Sum, Null, PivotTotalPosition.Rows) The grand total located by rows as a sum of corresponding dimensions located above the calculated element. It can be used in formulas of calculated elements.

See also:

Functions Available in Expression Editor │ TotalsIPivotClass.Total