IMsFormulaTransform.CreateCoord

Syntax

CreateCoord(OutputVariable: IMsFormulaTransformVariable): IMsFormulaTransformCoord;

Parameters

OutputVariable. The output variable, for which it is necessary to determine parameters, by which the model will be calculated.

Description

The CreateCoord method creates an object containing parameters of the output variable required for model calculation.

Example

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("Model_1", MB.ItemById("KONT_MODEL").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;

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 Model_1 identifier will be calculated. The calculation is executed by the Fact dimension of the output variable. If the variable has the additional dimensions, the calculation is performed by the first elements of these dimensions.

See also:

IMsFormulaTransform