IMsFormulaTransformCoord.Dimension

Syntax

Dimension(Index: Integer): IDimInstance;

Parameters

Index. Index of additional dimension.

Description

The Dimension property returns data of additional dimension by index.

Example

Executing the example requires that the modeling container includes the model, that uses the method of linear regression for calculation. The output variable contains one additional dimension.

Sub UserProc;
Var
    MB: IMetabase;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    VarTrans: IMsFormulaTransformVariable;
    Tree: IMsFormulaTransformSlicesTree;
    Slice: IMsFormulaTransformSlice;
    Selector: IMsFormulaTransformSelector;
    Formula: IMsFormula;
    LinReg: IMsLinearRegressionTransform;
    Coord: IMsFormulaTransformCoord;
    Calc: IMsModelCalculation;
    i: Integer;
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(19900101);
    Calc.Period.IdentificationEndDate := DateTime.ComposeDay(20071231);
    Calc.Period.ForecastStartDate := DateTime.ComposeDay(20080101);
    Calc.Period.ForecastEndDate := DateTime.ComposeDay(20101231);
    i := Coord.Dimension(0).Attributes.Item(0).LookupValue("Bryansk region");
    If i <> -1 Then
        Coord.Item(0) := i;
        LinReg.Identify(Calc As IMsMethodCalculation, Coord);
        Debug.WriteLine(LinReg.Summary(Coord).R2.ToString);
    End If;
End Sub UserProc;

After executing the example, the search is performed by the first attribute of the Bryansk Region value in data of the first additional dimension of the variable; in case the search is successful, factors of the model equation are identified by the given element.

See also:

IMsFormulaTransformCoord