IMsFormulaTransformVariable.DimAttributeId

Syntax

DimAttributeId: String;

Description

The DimAttributeId property determines identifier of dictionary attribute, to which variable refers to.

Comments

For correct work, specify identifier of time series attribute that refers to the dictionary, to which the attribute belongs. To do this, use the IMsFormulaTransformVariable.AttributeId property.

Example

Executing the example requires that the repository contains a modeling container with the MS identifier, containing a model with the MODEL_DIMATTRID identifier. This model must contain a factor based on time series database containing a custom time series attribute with the CITY identifier. This attribute must be a link to the dictionary containing the KEY attribute.

Sub UserProc;
Var
    mb: IMetabase;
    MSKey: Integer;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    InpVar: IMsFormulaTransformVariable;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get modelling container key
    MSKey := mb.GetObjectKeyById("MS");
    // Get the model
    Model := mb.ItemByIdNamespace("MODEL_DIMATTRID", MSKey).Edit As IMsModel;
    // Get model parameters
    Transform := Model.Transform;
    // Get model factor
    InpVar := Transform.Inputs.Item(0);
    // Set attribute, to which dictionary the factor will refer to
    InpVar.AttributeId := "CITY";
    // Set dictionary attribute, to which the factor will refer to
    InpVar.DimAttributeId := "KEY";
    // Save changes
    (Model As IMetabaseObject).Save;
End Sub UserProc;

After executing the example value of the first model factor is determined by value of the KEY attribute from the dictionary, to which the CITY time series attribute refers.

See also:

IMsFormulaTransformVariable