IncludedCount: Integer;
The IncludedCount property returns the number of sets used for model calculation.
Executing the example requires that the modeling container (CONT_MODEL) contains a model (BinReg) that uses the binary regression method for calculation.
Sub UserProc;
Var
MB: IMetabase;
SpaceDescr: IMetabaseObjectDescriptor;
MObj: IMetabaseObject;
Model: IMsModel;
Trans: IMsFormulaTransform;
VarTrans: IMsFormulaTransformVariable;
Tree: IMsFormulaTransformSlicesTree;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
Binary: IMsBinaryRegressionTransform;
Explanatories: IMsCompositeFormulaTermSetList;
i, j: Integer;
TermSet: IMsCompositeFormulaTermSet;
CompTerm: IMsCompositeFormulaTerm;
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;
Explanatories := Binary.Explanatories;
Debug.WriteLine("Terms used for model calculation:");
For i := 0 To Explanatories.Count - 1 Do
TermSet := Explanatories.Item(i);
If TermSet.Included Then
For j := 0 To TermSet.Count - 1 Do
CompTerm := TermSet.Item(j);
Debug.WriteLine(" " + CompTerm.ExpressionText);
End For;
End If;
End For;
Debug.WriteLine("Number of sets used for model calculation: " + Explanatories.IncludedCount.ToString);
End Sub UserProc;
After executing the example sets of terms of the explained series used for model calculation are displayed in the console window. Their total number is also displayed.
See also: