IRubricatorDictionaryLookup.GetFactors

Fore Syntax

GetFactors: Array;

Fore.NET Syntax

GetFactors: System.Array;

Description

The GetFactors property returns found time series.

Comments

Use the IRubricatorDictionaryLookup.LookupFactors method to get array of keys of the found time series.

Fore Example

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

Add links to the Cubes, Metabase, Rds system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    RubDesc: IMetabaseObjectDescriptor;
    Factors: Array;
    RubrIn: IRubricatorInstance;
    FactsLookup: IRubricatorFactsLookup;
    f: IRubricatorFactor;
    Record: IRubricatorRecord;
    a: Array;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    RubDesc := MB.ItemById(
"TSDB");
    RubrIn := RubDesc.Open(
NullAs IRubricatorInstance;
    FactsLookup := RubrIn.CreateFactsLookup;
    FactsLookup.WhereFactorKey := 151515;
    FactsLookup.WhereRevisionKey := -
1;
    FactsLookup.Open(DictionaryCursorOptions.None);
    Factors := FactsLookup.GetFactors;
    
If Factors <> Null Then
        f := Factors[
0];
        Record := f.FactData 
As IRubricatorRecord;
        a := Record.Record.Value 
As Array;
        
If a <> Null Then
            
For i := 0 To a.Length - 1 Do
                Debug.WriteLine(a[i] 
As String);
            
End For;
        
End If;
    
End If;
End Sub UserProc;

Example execution result: the time series with the 151515 key is searched by the last revision. If the time series is found, the console window displays the record containing information about it.

Fore.NET Example

The requirements and result of Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Rds;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    RubDesc: IMetabaseObjectDescriptor;
    Factors: Array;
    RubrIn: IRubricatorInstance;
    FactsLookup: IRubricatorFactsLookup;
    f: IRubricatorFactor;
    Record: IRubricatorRecord;
    a: Array;
    i: Integer;
Begin
    MB := Params.Metabase;
    RubDesc := MB.ItemById["TSDB"];
    RubrIn := RubDesc.Open(NullAs IRubricatorInstance;
    FactsLookup := RubrIn.CreateFactsLookup();
    FactsLookup.WhereFactorKey := 151515;
    FactsLookup.WhereRevisionKey := uinteger.MaxValue;
    FactsLookup.Open(DictionaryCursorOptions.dcuoNone);
    Factors := FactsLookup.GetFactors();
    If Factors <> Null Then
        f := Factors[0As IRubricatorFactor;
        Record := f.FactData As IRubricatorRecord;
        a := Record.Record.Value As Array;
        If a <> Null Then
            For i := 0 To a.Length - 1 Do
                System.Diagnostics.Debug.WriteLine(a[i]);
            End For;
        End If;
    End If;
End Sub;

See also:

IRubricatorDictionaryLookup