IMsAttributesFormulasList.FindByAttributeId

Syntax

FindByAttributeId(AttributeId: String): IMsFormulaTransform;

Parameters

AttributeId. Attribute identifier, which calculation method should be found.

Description

The FindByAttributeId method searches for method by the attribute it calculates.

Comments

If no object with the specified identifier is found, the method returns Null.

Example

Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. The database modeling container contains a model with the MODEL identifier that contains methods for calculating additional attributes.

Add links to the Cubes, Metabase, Ms 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).Bind As IMsModel;
    FormulasList := Model.AttributeFormulasList;
    AttrTranfsorm := FormulasList.FindByAttributeId("UNIT");
    If AttrTransform <> Null Then
       TransfIndex := FormulasList.IndexOf(AttrTranfsorm);
        FormulasList.Remove(TransfIndex);
    End If;
   (Model As IMetabaseObject).Save;
End Sub;

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:

IMsAttributesFormulasList

Related work items

Requirement 157358