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 a time series database with the OBJ_RUBRICATOR identifier. INDICATOR is the custom attribute of database time series that refers to the dictionary. NATIONAL_ACCOUNTS is a group of dictionary elements, to which the INDICATOR attribute refers. The modeling container of this time series database must include the MODEL_DETERM model based on time series and calculated using the method of determinate equation.

Add links to the Metabase, Ms, Cubes, Rds, Dimensions 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