Show contents 

Cubes > Cubes Assembly Interfaces > IStandardCubeFactBinding > IStandardCubeFactBinding.AggregatedDataType

IStandardCubeFactBinding.AggregatedDataType

Syntax

AggregatedDataType: CubeFactBindingAggregatedDataType;

Description

The AggregatedDataType property determines a data type after aggregation.

Example

Executing the example requires that the repository contains a standard cube with the OBJ_CUBE identifier. Facts bindings must be set up in this cube.

Sub UserProc;
Var
    MB: IMetabase;
    StdCube: IStandardCube;
    Dest: IStandardCubeDestination;
    StdDataset: IStandardCubeDataset;
    FactBinds: IStandardCubeFactBindings;
    FactBind: IStandardCubeFactBinding;
    FactDimension: IDimInstance;
    Iter: IDimIterator;
    DimElements: IDimElements;
    Id: String;
Begin
    MB := MetabaseClass.Active;
    StdCube := MB.ItemById("OBJ_CUBE").Edit As IStandardCube;
    Dest := StdCube.Destinations.Item(0);
    FactDimension := Dest.FactDimension.OpenDimension;
    DimElements := FactDimension.Elements;
    Iter := DimElements.Elements.Iterator;
    Iter.First;
    While Iter.Next Do
        Id := DimElements.Id(Iter.Element);
        StdDataset := Dest.Datasets.Item(0);
        FactBinds := Dest.FactBindings(StdDataset);
        FactBind := FactBinds.Binding(id);
        If FactBind.Formula <> Null Then
            FactBind.AggregationType := CubeFactBindingAggregationType.Custom;
            FactBind.CustomAggregateFunction := "SUM";
            FactBind.DistinctAggregate := True;
            FactBind.AggregatedDataType := CubeFactBindingAggregatedDataType.FixedPoint;
            FactBind.AggregatedDataTypePrecision := 3;
        End If;
    End While;
    (StdCube As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a custom method of aggregation calculation on the data source is determined for cube facts. Numbers with fixed point calculated to within one thousandth are the result of aggregation. Aggregation method - sum.

See also:

IStandardCubeFactBinding