IPivotDimensionLevelPropertiesCommon.HierarchyTotals

Fore Syntax

HierarchyTotals: IPivotTotals;

Fore.NET Syntax

HierarchyTotals: Prognoz.Platform.Interop.Pivot.IPivotTotals;

Description

The HierarchyTotals property returns the object that is used to work with hierarchy totals.

Comments

Totals are calculated by hierarchy by all child elements.

To get an object that is used to work with totals by level, use IPivotDimensionLevelPropertiesCommon.LevelTotals.

Fore Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier. Report data source is a cube that contains the dimensions consisting of several levels.

Add links to the Express, Matrix, Metabase, and Pivot system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Express: IEaxAnalyzer;
    Pivot: IPivot;
    LHeader: IPivotHeader;
    HierTotals: IPivotTotals;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get express report
    Express := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get display settings of report data table
    Pivot := Express.Pivot;
    // Get collection of dimensions located by rows
    LHeader := Pivot.LeftHeader;
    // Get object used to work with totals by hierarchy
    HierTotals := LHeader.HierarchyTotals;
    // Enable displaying of totals
    If Not HierTotals.HasTotals Then
        HierTotals.Totals := Tristate.OnOption;
    End If;
    // Set aggregation method - sum
    HierTotals.Method := BasicAggregatorOperation.Sum;
    // Save changes
    (Express As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the table sidehead displays totals by hierarchy.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Matrix;
Imports Prognoz.Platform.Interop.Pivot;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Express: IEaxAnalyzer;
    Pivot: IPivot;
    LHeader: IPivotHeader;
    HierTotals: IPivotTotals;
Begin
    // Get repository
    MB := Params.Metabase;
    // Get express report
    Express := MB.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
    // Get display settings of report data table
    Pivot := Express.Pivot;
    // Get collection of dimensions located by rows
    LHeader := Pivot.LeftHeader;
    // Get object used to work with totals by hierarchy
    HierTotals := LHeader.HierarchyTotals;
    If Not HierTotals.HasTotals Then
        HierTotals.Totals := Tristate.tsOnOption;
    End If;
    // Set aggregation method - sum
    HierTotals.Method := BasicAggregatorOperation.baoSum;
    // Save changes
    (Express As IMetabaseObject).Save();
End Sub;

See also:

IPivotDimensionLevelPropertiesCommon