Slice: IMsFormulaTransformSlice;
The Slice property determines variable slice corresponding to the given term.
Executing the example requires that the repository contains a modeling container with the KONT_MODEL identifier. This container contains a modeling problem with the New_NonLinReg identifier, that uses the method of non-linear regression for calculation.
Sub Main;
Var
MB: IMetabase;
Model: IMsModel;
Trans: IMsFormulaTransform;
NonLinear: IMsNonLinearRegressionTransform;
Oper: IMsFormulaTermList;
Info: IMsFormulaTermInfo;
Slice: IMsFormulaTransformSlice;
Sels: IDimSelectionSet;
Sel: IDimSelection;
i: Integer;
Begin
MB := MetabaseClass.Active;
Model := MB.ItemByIdNamespace("New_NonLinReg", MB.ItemById("KONT_MODEL").Key).Bind As IMsModel;
Trans := Model.Transform;
NonLinear := Trans.FormulaItem(0).Method As IMsNonLinearRegressionTransform;
Oper := NonLinear.Operands;
For i := 0 To Oper.Count - 1 Do
Info := Oper.Item(i).TermInfo;
Slice := Info.Slice;
Debug.WriteLine(Slice.Id + " " + Slice.Name);
Sels := Slice.Selection;
For Each Sel In Sels Do
Debug.WriteLine("Dimension: " + Sel.Dimension.Ident + "; Selected elements: " + Sel.ToString);
End For;
End For;
End Sub Main;
After executing the example the information about slices, to which the terms, that are created in this model, are corresponded, is displayed in the development environment console. Names of slices, identifiers of the modeling variables, on the basis of which they are created are displayed, as well as the selection by the additional dimensions if they are available in variables is displayed.
See also: