IMsCrossDimensionAggregationTransform.Operands

Syntax

Operands: IMsFormulaTermList;

Description

The Operands property returns the collection of terms that are used to set up aggregation expression.

Example

Executing the example requires that the repository contains a time series database with the FC identifier. The modeling container of this database must include a model with the MODEL_AGGR identifier calculated using extended aggregation.

Sub Main;

Var

mb: IMetabase;

Rubr: IRubricator;

msDescr: IMetabaseObjectDescriptor;

Model: IMsModel;

Transform: IMsFormulaTransform;

Formula: IMsFormula;

Aggr: IMsCrossDimensionAggregationTransform;

i: Integer;

strsGen: IMsFormulaStringGenerator;

Begin

mb := MetabaseClass.Active;

Rubr := mb.ItemById("FC").Bind As IRubricator;

msDescr := Rubr.ModelSpace;

Model := mb.ItemByIdNamespace("MODEL_AGGR", msDescr.Key).Bind As IMsModel;

Transform := Model.Transform;

Formula := Transform.FormulaItem(0);

Aggr := Formula.Method As IMsCrossDimensionAggregationTransform;

strsGen := Formula.CreateStringGenerator;

strsGen.ShowFullVariableNames := True;

Debug.WriteLine("Aggregation expression: " + strsGen.Exeslicee);

Debug.WriteLine("Terms used in aggregation expression:");

For i := 0 To Aggr.Operands.Count - 1 Do

Debug.WriteLine("  " + Aggr.Operands.Item(0).TermToText);

End For;

Debug.WriteLine("Term that contains aggregation results: " + Aggr.Result.TermToText);

End Sub Main;

After executing the example information about the aggregation expression, terms used in the expression and the term that contains aggregation results are displayed in the console window. For example:

Aggregation expression: Countries in transition for publication|National Account[t] = Sum(BCA[t] / BCI[t] + NGDP[t])

Terms used in aggregation expression:

  BCA[t]

  BCI[t]

  NGDP[t]

The term that contains aggregation results: Countries in transition for publication|National Account[t]

See also:

IMsCrossDimensionAggregationTransform