IMsDeterministicTransform.AggregateOperands

Syntax

AggregateOperands: IMsCompositeFormulaTermList;

Description

The AggregateOperands property returns the collection of composite terms that are used to calculate aggregation.

Example

Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. INDICATOR is the custom attribute of database indicators that refers to the dictionary. NATIONAL_ACCOUNTS is a group of dictionary elements, to which the INDICATOR attribute refers. The modeling container of this database must include the MODEL_DETERM model based on indicators and calculated using the determinate equation method.

Add links to the Cubes, Dimensions, Metabase, Ms, Rds system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Ruby: IRubricator;
    ModelCont: IMetabaseObjectDescriptor;
    MObj: IMetabaseObject;
    Model: IMsModel;
    Trans: IMsFormulaTransform;
    Formula: IMsFormula;
    Determ: IMsDeterministicTransform;
    MetaAttr: IMetaAttribute;
    DimObj: IMetabaseObjectDescriptor;
    Group: IDimElementGroup;
    AggrOperands: IMsCompositeFormulaTermList;
    AggrOper: IMsCompositeFormulaTerm;
    DimModel: IDimensionModel;
Begin
    MB := MetabaseClass.Active;
    Ruby := MB.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;
    ModelCont := Ruby.ModelSpace;
    MObj := mb.ItemByIdNamespace("MODEL_DETERM", ModelCont.Key).Edit;
    Model := MObj As IMsModel;
    Trans := Model.Transform;
    Formula := Model.Transform.FormulaItem(0);
    Determ := Formula.Method As IMsDeterministicTransform;
    MetaAttr := Ruby.Facts.Attributes.FindById("INDICATOR");
    DimObj := MetaAttr.ValuesObject;
    Group := Mb.ItemByIdNamespace("NATIONAL_ACCOUNTS", DimObj.Key).Edit As IDimElementGroup;
    AggrOperands := Determ.AggregateOperands;
    AggrOper := AggrOperands.Add;
    AggrOper.AggregationGroup := Group;
    DimModel := DimObj.Bind As IDimensionModel;
    AggrOper.AggregationAttrKey := DimModel.Attributes.FindById("KEY").Key;
    MObj.Save;
End Sub UserProc;

After executing the example a new term is added to the collection of composite terms that are used on aggregation composition. The group and the key of aggregation attribute are set to it.

See also:

IMsDeterministicTransform