IOrmCondition.ConditionJoin

Syntax

ConditionJoin: OrmLogicalOperator;

Description

The ConditionJoin property determines a logical operator that is used to join the current condition with the previous one.

Comments

The logical AND is used by default, that is, ConditionJoin = OrmLogicalOperator.And_.

Example

Executing the example requires that the repository contains a time series database with the TSDB identifier containing an integer attribute of time series with the COUNTRY identifier. The database series should be identified with mnemonics.

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

Sub UserConditionJoin;
Var
    MB: IMetabase;
    RubrInst: IRubricatorInstance;
    FactsLookup: IRubricatorFactsLookup;
    MetaDLookup: IMetaDictionaryLookup;
    Conds: IOrmConditions;
    Cond_1, Cond_2: IOrmCondition;
    Factors: Array;
    i: Integer;
    Factor: IRubricatorFactor;
    FactData: IRubricatorFactData;
Begin
    MB := MetabaseClass.Active;
    // Get instance of time series database
    RubrInst := MB.ItemById("TSDB").Open(NullAs IRubricatorInstance;
    // Create an object that is used to search factors
    FactsLookup := RubrInst.CreateFactsLookup;
    MetaDLookup := FactsLookup.Lookup;
    Conds := MetaDLookup.Where;
    // Add condition 1
    Cond_1 := Conds.Add;
    Cond_1.AttributeName := "COUNTRY";
    Cond_1.Value := 512;
    // Add condition 2
    Cond_2 := Conds.Add;
    Cond_2.ConditionJoin := OrmLogicalOperator.Or_;
    Cond_2.AttributeName := "COUNTRY";
    Cond_2.Value := 914;
    // Search and display search results in the console window
    FactsLookup.Open(DictionaryCursorOptions.None);
    Factors := FactsLookup.GetFactors;
    If Factors <> Null Then
        For i := 0 To Factors.Length - 1 Do
            Factor := Factors[i];
            FactData := Factor.FactData;
            Debug.WriteLine((i + 1).ToString + ". " + FactData.Mnemo);
        End For;
    End If;
    FactsLookup.Close;
End Sub UserConditionJoin;

After executing the example the console window displays mnemonics of the time series corresponding to the conditions: value of the COUNTRY attribute is equal to 512 or 914.

See also:

IOrmCondition