IUnitsDimInstance.BasisByElementKey

Syntax

BasisByElementKey(ElementKey: Variant): Integer;

Parameters

ElementKey. The key of dictionary element.

Description

The BasisByElementKey property returns index of basic measurement unit by element key.

Comments

Basic unit of measure is unit with 1 scale of the element measure.

Example

Executing the example requires that the repository contains a time series database with the FC identifier. Base contains indicator with the 336699 key. Add links to the Metabase, Cubes and Dimensions system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    Cat: IMetabaseObject;
    Inst: IRubricatorInstance;
    UnitsDim: IDimInstance;
    FactD: IRubricatorFactData;
    Units: IUnitsDimInstance;
    Elements: IDimElements;
    Key, Base: Integer;
    El: Integer;
Begin
    Mb := MetabaseClass.Active;
    Cat := Mb.ItemById("FC").Bind;
    Inst := Cat.Open(NullAs IRubricatorInstance;
    UnitsDim := Inst.UnitsDimension;
    Units := UnitsDim As IUnitsDimInstance;
    FactD := Inst.GetFactData(336699);
    Key := FactD.Units;
    Elements := UnitsDim.Elements;
    Base := Units.BasisByElementKey(Key);
    Debug.WriteLine("Base unit of measure: " + Elements.Name(Base));
    El := Units.ElementByKey(Key);
    Debug.WriteLine("Unit of measure: " + Elements.Name(El));
End Sub UserProc;

After executing the example the console window shows the name of unit of measure and base unit of measure for indicator with the 336699 key.

See also:

IUnitsDimInstance