ICustomDimTree.AttributeValue

Syntax

AttributeValue(PrimaryKey: Variant; AttributeIndex: Integer): Variant;

Parameters

PrimaryKey. Primary key of the element for which the attribute value should be determined.

AttributeIndex. Index of the attribute which value is to be determined.

Description

The AttributeValue property determines the specified attribute value for selected dictionary element.

Comments

Basic attributes are generated in designed dictionary, which is created on generating local dimension of facts, as follows:

Index Attribute
0 Key
1 Name
2 Order

If designed dictionary is created on saving alternative hierarchy of analytical data area, the attribute list and order will differ and will depend on the dimension for which the alternative hierarchy was saved. Index of necessary attribute can be calculated on parsing the ICustomDimension.Attributes attribute collection.

Example

Executing the example requires a standard cube with the STD_CUBE identifier in the repository.

Sub Main;
Var
    MB: IMetabase;
    Cube: IStandardCube;
    CustDim: ICustomDimension;
    CustDimTree: ICustomDimTree;
    Elems: ICustomDimElements;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    Cube := MB.ItemById("STD_CUBE").Edit As IStandardCube;
    CustDim := Cube.FactDimension.Dimension As ICustomDimension;
    CustDimTree := CustDim.Tree;
    Elems := CustDim.Elements;
    For i := 0 To Elems.RowCount - 1 Do
        CustDimTree.AttributeValue(Elems.AttributeValue(i, 0), 1) := "Element " + i.ToString;
    End For;
    (Cube As IMetabaseObject).Save;
End Sub Main;

After executing the example names of all fact dimension elements are changed.

See also:

ICustomDimTree