IRubricatorInstance.CreateFactsLookup

Syntax

CreateFactsLookup: IRubricatorFactsLookup;

Description

The CreateFactsLookup method creates an object searching for indicators.

Example

Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. This database must contain an indicator attribute with the COUNTRIES identifier.

Sub UserProc;
Var
    MB: IMetabase;
    RubrInst: IRubricatorInstance;
    FactsLookup: IRubricatorFactsLookup;
    MetaDLookup: IMetaDictionaryLookup;
    ObservLookup: IRubricatorObservationsLookup;
    Key: Array Of Integer;
    i: Integer;
    Cond: IOrmCondition;
Begin
    MB := MetabaseClass.Active;
    RubrInst := MB.ItemById("OBJ_RUBRICATOR").Open(NullAs IRubricatorInstance;
    FactsLookup := RubrInst.CreateFactsLookup;
    MetaDLookup := FactsLookup.Lookup;
    Cond := MetaDLookup.Where.Add;
    Cond.AttributeName := "COUNTRIES";
    Cond.Value := 512;
    ObservLookup := RubrInst.CreateObservationsLookup(Null);
    ObservLookup.WhereCalendarLevel := DimCalendarLevel.Year;
    i := RubrInst.LookupFactors(FactsLookup, ObservLookup).Length;
    Key := New Integer[i];
    Key := RubrInst.LookupFactors(FactsLookup, ObservLookup);
End Sub UserProc;

After executing the example the Key array contains indicators keys that satisfy the following conditions: annual frequency is present in the indicator, and the COUNTRIES attribute value equals to 512.

See also:

IRubricatorInstance