IDimIndexInstanceLookup.Level

Syntax

Level: Integer;

Description

The Level property determines level of dictionary where element is searched.

Comments

If the property is set to -1, search is performed whatever the level is.

Example

Executing the example requires that repository contains table dictionary with the DIM_SEP which consists of two levels.

Add links to the Dimensions, Metabase system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    instance: IDimInstance;
    indexesinstance: IDimIndexesInstance;
    indexinstance: IDimIndexInstance;
    instlook: IDimIndexInstanceLookup;
    arr, arr1: array Of Variant;
    i, c: integer;
Begin
    // Get repository
    mb := MetabaseClass.Active;
    // Get access to dictionary data
    instance := mb.ItemById("DIM_SEP").Open(NullAs IDimInstance;
    // Create areas for search
    Arr := New Variant[1];
    Arr1 := New Variant[1];
    // Get collection of dictionary indexes
    indexesinstance := instance.Indexes;
    // Get the first dictionary index
    indexinstance := indexesinstance.Item(0);
    // Create object to search dictionary elements
    instlook := indexinstance.CreateDimIndexLookup;
    // Set level for search
    instlook.Level := 2;
    // Find the 1000 and 1020 elements
    Arr[0] := 1000;
    Arr1[0] := 1020;
    // Get element sequence number
    i := indexinstance.LookUp(Arr);
    // Get element sequence number
    c := indexinstance.LookUp(Arr1);
    // Display sequence number to the console
    Debug.WriteLine("Sequence number of found element = " + i.ToString);
    // Display sequence number to the console
    Debug.WriteLine("Sequence number of found element = " + c.ToString);
End Sub UserProc;

After executing the example the console displays sequence orders of found elements.

See also:

IDimIndexInstanceLookup