FindByAttributeId(AttributeId: String): IMsFormulaTransform;
AttributeId - attribute identifier, the calculation method of which must be found.
The FindByAttributeId method searches for method by the attribute it calculates.
If no object with the specified identifier is found, the method returns Null.
Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. The database modeling container includes a model with the MODEL identifier that contains methods that are used to calculate additional attributes. Also, before executing the procedure add links to the Ms, Cubes, Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Rubr: IRubricator;
Model: IMsModel;
FormulasList: IMsAttributesFormulasList;
AttrTranfsorm: IMsFormulaTransform;
TransfIndex: Integer;
Begin
Mb := MetabaseClass.Active;
Rubr := Mb.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;
Model := Mb.ItemByIdNamespace("MODEL", Rubr.ModelSpace.Key).Edit As IMsModel;
FormulasList := Model.AttributeFormulasList;
AttrTranfsorm := FormulasList.FindByAttributeId("UNIT");
If AttrTranfsorm <> Null Then
TransfIndex := FormulasList.IndexOf(AttrTranfsorm);
FormulasList.Remove(TransfIndex);
End If;
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the method is searched, that calculates the attribute with the UNIT identifier, for the model. If the method is found, it is deleted.
See also: