IMsFormulaTransformSelector.Level

Syntax

Level: DimCalendarLevel;

Description

The Level property determines the level of the calendar dimension of the variable slice.

Example

Executing the example requires that the modeling container with the OBJ_TRANSFORMATION identigfier includes a model with the OBJ_MODEL identifier. The annual frequency should be determined for variables, that are the part of model.

Sub Main;

Var

MB: IMetabase;

Model: IMsModel;

Transform: IMsFormulaTransform;

VarTrans: IMsFormulaTransformVariable;

Tree: IMsFormulaTransformSlicesTree;

Slice: IMsFormulaTransformSlice;

Selector: IMsFormulaTransformSelector;

Formula: IMsFormula;

LinReg: IMsLinearRegressionTransform;

Coord: IMsFormulaTransformCoord;

Calc: IMsModelCalculation;

CalcRes: IMsModelCalculationResult;

Begin

MB := MetabaseClass.Active;

Model := MB.ItemByIdNamespace("OBJ_MODEL", MB.ItemById("OBJ_TRANSFORMATION").Key).Bind As IMsModel;

Transform := Model.Transform;

VarTrans := Transform.Outputs.Item(0);

Tree := VarTrans.SlicesTree(VarTrans);

Slice := Tree.CreateSlice(1);

Selector := Model.Output.Item(0).Transform.CreateSelector;

Selector.Slice := Slice;

Selector.Level := DimCalendarLevel.Year;

Formula := Model.Transform.Transform(Selector);

LinReg := Formula.Method As IMsLinearRegressionTransform;

Coord := Model.Transform.CreateCoord(VarTrans);

Calc := Model.CreateCalculation;

Calc.Period.IdentificationStartDate := DateTime.ComposeDay(1990, 01, 01);

Calc.Period.IdentificationEndDate := DateTime.ComposeDay(2007, 12, 31);

Calc.Period.ForecastStartDate := DateTime.ComposeDay(2008, 01, 01);

Calc.Period.ForecastEndDate := DateTime.ComposeDay(2010, 12, 31);

CalcRes := LinReg.Execute(Calc As IMsMethodCalculation, Coord);

End Sub Main;

After executing the example the model with the OBJ_MODEL identifier is calculated. Calculation is made by the Fact dimension of the output variable. If the variable has additional dimensions, calculation is performed by the first elements of these dimensions.

See also:

IMsFormulaTransformSelector