IMsFormulaTermSet.SingleTerm

Syntax

SingleTerm: IMsFormulaTermInfo;

Description

The SingleTerm property determines the leading term in the set.

Example

To execute the example, the modeling container (CONT_MODEL) must contain a model (BinReg), that uses the binary regression method for calculation.

Sub Main;

Var

MB: IMetabase;

SpaceDescr: IMetabaseObjectDescriptor;

MObj: IMetabaseObject;

Model: IMsModel;

Trans: IMsFormulaTransform;

VarTrans: IMsFormulaTransformVariable;

Tree: IMsFormulaTransformSlicesTree;

Slice: IMsFormulaTransformSlice;

Selector: IMsFormulaTransformSelector;

Formula: IMsFormula;

Binary: IMsBinaryRegressionTransform;

Explained: IMsFormulaTermSet;

i: Integer;

Term: IMsFormulaTerm;

Begin

MB := MetabaseClass.Active;

SpaceDescr := mb.ItemById("CONT_MODEL");

MObj := MB.ItemByIdNamespace("BinReg", SpaceDescr.Key).Bind;

Model := MObj As IMsModel;

Trans := Model.Transform;

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

Tree := VarTrans.SlicesTree(VarTrans);

Slice := Tree.CreateSlice(1);

Selector := Model.Transform.CreateSelector;

Selector.Slice := Slice;

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

Binary := Formula.Method As IMsBinaryRegressionTransform;

Explained := Binary.Explained;

Debug.WriteLine(output series terms:);

For i := 0 To Explained.Count - 1 Do

Term := Explained.Item(i);

Debug.WriteLine("  " + Term.TermToText);

End For;

Debug.WriteLine(Leading term: + Explained.SingleTerm.TermText);

End Sub Main;

After executing the example, terms of output series and leading term are displayed in the console window.

See also:

IMsFormulaTermSet