IPivotEvaluatorTotals.DimElementTotalType

Syntax

DimElementTotalType(DimKey: Integer; Element: Integer): PivotEvaluatorElementType;

Parameters

DimKey. Key of the dimension, for element of which calculation of own total is set up.

Element. Dimension element index.

Description

The DimElementTotalType property determines own type of total that will be calculated for the specified dimension element.

Comments

The property is relevant if the DimElementTotalEnabled property is set to True. Depending on the location of the dimension with the DimKey key, one should enable calculation of row/column totals. The value of own total by element will replace all types of row/column totals.

To reset calculation of own total, use the RemoveDimElementTotal method.

Example

Executing the example requires that the repository contains a regular report with the REPORT identifier. The source, based on which a slice is created and a data table is added, is added to the report.

Add links to the Dimensions, Express, Metabase, Pivot, Report system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    Report: IPrxReport;
    DataArea: IEaxDataArea;
    Pivot: IPivot;
    Totals: IPivotEvaluatorTotals;
    Dim: IDimInstance;
Begin
    Mb := MetabaseClass.Active;
    // Open report for edit
    Report := Mb.ItemById("REPORT").Edit As IPrxReport;
    // Get base for creating an analytical data area slice
    DataArea := Report.DataArea;
    Pivot := (DataArea.Slices.Item(0As IEaxDataAreaPivotSlice).Pivot;
    // Totals
    Totals := Pivot.Evaluator.Totals;
    // Enable column totals
    Totals.ColumnTotalsEnabled := True;
    Totals.ColumnTypes := PivotEvaluatorElementType.Avg;
    // Enable specific total for the first dimension element located in heading
    Dim := Pivot.TopHeader.Dim(0);
    Totals.DimElementTotalEnabled(Dim.Key, 0) := True;
    Totals.DimElementTotalType(Dim.Key, 0) := PivotEvaluatorElementType.Max;
    // Save changes
    Report.MetabaseObject.Save;
End Sub UserProc;

After executing the example, calculation of column totals is enabled for the analytical data area slice. The calculated type of totals - average. The own type of totals, which is maximum value, will be enabled for the first dimension element located in heading.

See also:

IPivotEvaluatorTotals