IPivotEvaluatorTotals.Add

Syntax

Add(Dim: IDimInstance; BaseLevel: Integer; TotalTypes: Integer): IPivotEvaluatorTotalsItem;

Parameters

Dim. Dimensions, based on which it is necessary to calculate totals.

BaseLevel. Dimension level, based on which totals are calculated.

TotalTypes. Type of totals calculated at the specified dimension level.

Description

The Add property adds an element of the totals that are calculated by the specified level of the specified dimension.

Comments

As a value of the TotalTypes parameter, specify decimal number corresponding to the type of totals. Compiling of a totals combination requires indicating of the values sum of the corresponding totals. The PivotEvaluatorElementType enumerable type contains totals values that can be calculated.

Example

Executing the example requires a form with the Button1 button, the TabSheetBox component and the UiErAnalyzer component named UiErAnalyzer1 that is a data source for TabSheetBox. For express report loaded to UiErAnalyzer1 the calendar dimension is the first dimension set by rows.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    OLAP: IEaxAnalyzer;
    Pivot: IPivot;
    Totals: IPivotEvaluatorTotals;
    Dim: IDimInstance;
Begin
    OLAP := UiErAnalyzer1.ErAnalyzer;
    Pivot := OLAP.Pivot;
    Dim := Pivot.LeftHeader.Dim(0);
    Totals := Pivot.Evaluator.Totals;
    Totals.Add(Dim, Dim.Levels.Item(0).Number, PivotEvaluatorElementType.Sum);
    Totals.Add(Dim, Dim.Levels.Item(1).Number, PivotEvaluatorElementType.Max);
    Pivot.Refresh;
End Sub Button1OnClick;

After executing the example clicking the button calculates the following totals for the table: by Days level - maximum value; by Months level - Sum.

See also:

IPivotEvaluatorTotals