IPivotClass.Total

Syntax

Total(Type: PivotEvaluatorElementType;

[Relation: Variant = Null;]

[Position: PivotTotalPosition = 0]): Variant;

Parameters

Type. Totals calculation method.

Relation. Dimension element, by which the calculated total must be obtained.

Position. Totals position (by rows or by columns).

Description

The Total property returns total value.

Comments

The method is used in transformation formulas of analytical data area calculated elements. Only name of the Total method without the PivotClass class is specified in formula equations. Calling of the method from macros in Fore is not supported.

Use the Total method as a function in data transformation expression formulas.

The mandatory requirement for method working is enabling calculation of required totals for table rows or columns. If totals are not calculated, the method returns empty values.

The Relation parameter is optional. If the parameter is not specified, the method returns total of the element, after which 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 method returns the grand total calculated by the specified element.

The Position parameter is optional. If the parameter is not specified, or the value matches the location of created element, the method 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 the PivotTotalPosition.Rows value is specified, and vice versa), the method returns total value by rows/columns respectively.

To create formulas and expressions, see the Creating Formulas and Expressions article.

The example of calculation element setup is given in IEaxDataAreaSlice.CalcTransformations.

Example of Use in Expressions

Expression:

Total(PivotEvaluatorElementType.Sum, Null, PivotTotalPosition.Rows);

Result: the grand total located by rows as a sum of corresponding dimensions located above the calculated element.

Before:

After:

Application: it can be used in calculated element formulas.

See also:

IPivotClass