FindByAttributeId(AttributeId: String): IMsFormulaTransform;
AttributeId - attribute identifier, the calculation method of which is necessary to be found.
The FindByAttributeId method finds method by the attribute it calculates.
If no object with 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. Database modeling container includes a model with the MODEL identifier that contains methods used to calculate additional attributes. Also, before executing the procedure it is necessary to 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 search of calculation method of attribute with the UNIT identifier is executed for the model. If the method is found, it is deleted.
See also: