SetAttributeExpression: String;
The SetAttributeExpression method sets the expression specified using the factor attributes as the model equation.
The set of attributes must unambiguously determine the factor. Attributes separator and order must match with the order and separator used in the time series database (see IMetaDictionary.AttributeNamings).
Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. The modeling container of this time series database must include the DETERM_MODEL model based on indicators and calculated using a determinate equation.
Add links to the Cubes, Metabase, Ms system assemblies.
Sub UserProc;
Var
mb: IMetabase;
ModelCont: IMetabaseObjectDescriptor;
Ruby: IRubricator;
obj: IMetabaseObject;
Transform: IMsFormulaTransform;
Model: IMsModel;
ModelMethod: IMsDeterministicTransform;
Formula: IMsFormula;
Begin
mb := MetabaseClass.Active;
Ruby := mb.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;
ModelCont := ruby.ModelSpace;
Obj := mb.ItemByIdNamespace("DETERM_MODEL",ModelCont.Key).Edit;
Model := Obj As IMsModel;
Transform := Model.Transform;
Formula := Transform.FormulaItem(0);
ModelMethod := Formula.Method As IMsDeterministicTransform;
ModelMethod.SetAttributeExpression("Years|Afganistan|GGB/ 2");
obj.Save;
End Sub;
After executing the example a new expression, as model equation, is set.
See also: