IRubricatorDictionaryLookup.LookupFactorsC

Fore Syntax

LookupFactorsC: Array;

Fore.NET Syntax

LookupFactorsC: System.Array;

Description

The LookupFactors method returns the composite keys array of the found time series.

Comments

The IRubricatorDictionaryLookup.WhereCompoundFactorKey property determines the composite key of the time series.

Fore Example

Executing the example requires that the repository contains a time series database with the RUBRICATOR_CUBE identifier. Add links to the Metabase, Cubes system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    RubI: IRubricatorInstance;
    pFactsLookup: IRubricatorFactsLookup;
    CompKey: Array[2];
    Key, arr: Array Of Variant;
    i, idx: Integer;
    s: String;
Begin
    mb := MetabaseClass.Active;
    RubI := mb.ItemById("RUBRICATOR_CUBE").Open(NullAs IRubricatorInstance;
    pFactsLookup := RubI.CreateFactsLookup;
    CompKey[0] := 512; CompKey[1] := 1009;
    pFactsLookup.WhereCompoundFactorKey := CompKey;
    If pFactsLookup.LookupFactorsC <> Null Then
        i := pFactsLookup.LookupFactorsC.Length;
    Debug.WriteLine(Found: + i.ToString);
        Key := New Variant[i];
        Key := pFactsLookup.LookupFactorsC;
        For i := 0 To Key.Length - 1 Do
            arr := Key[i] As Array Of Variant;
            s := "";
            For idx := 0 To arr.Length - 1 Do
                s := s + (arr[idx] As string) + "; ";
            End For;
            Debug.WriteLine(s);
        End For;
    End If;
End Sub UserProc;

Example execution result: the search by the values of a composite key is executed in the time series database, and results are displayed in the console window.

Fore.NET Example

Executing the example requires that the repository contains a time series database with the RUBRICATOR_CUBE identifier.

Imports Prognoz.Platform.Interop.Cubes;

[STAThread]
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    RubI: IRubricatorInstance;
    pFactsLookup: IRubricatorFactsLookup;
    CompKey: Array[2Of object;
    Key, arr: Array Of object;
    i, idx: Integer;
    s: String;
Begin
    mb := Params.Metabase;
    RubI := mb.ItemById["RUBRICATOR_CUBE"].Open(NullAs IRubricatorInstance;
    pFactsLookup := RubI.CreateFactsLookup();
    CompKey[0] := 512; CompKey[1] := 1009;
    pFactsLookup.WhereCompoundFactorKey := CompKey;
    If pFactsLookup.LookupFactorsC() <> Null Then
        i := pFactsLookup.LookupFactorsC().Length;
        System.Diagnostics.Debug.WriteLine(Found: + i.ToString());
        Key := New object[i];
        Key := pFactsLookup.LookupFactorsC() As Array Of object;
        For i := 0 To Key.Length - 1 Do
            arr := Key[i] As Array Of object;
            s := "";
            For idx := 0 To arr.Length - 1 Do
                s := s + (arr[idx].ToString()) + "; ";
            End For;
            System.Diagnostics.Debug.WriteLine(s);
        End For;
    End If;
End Sub;

Example execution result: the search by the values of a composite key is executed in the time series database, and results are displayed in the console window.

See also:

IRubricatorDictionaryLookup