IRubricatorFactData.IsEmpty

Fore Syntax

IsEmpty: Boolean;

Fore.NET Syntax

IsEmpty: boolean;

Description

The IsEmpty property determines whether the indicator of emptiness is set for the data series.

Comments

Emptiness indicator depends on the value of the Empty factors attribute (the EMPT identifier).

If all the values of time series in database on actual revision are empty (absent or equal Null), it is set with emptiness indicator. A new time series is considered as empty until data is not saved to it.

To update emptiness indicator of time series, use the IRubricatorInstance.RegenerateEmpty method.

Fore Example

Executing the example requires a time series database with the FC_IS_EMPTY identifier. Add links to the Metabase and Cubes system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    RubObj: IMetabaseObject;
    Rubr: IRubricator;
    RubrInst: IRubricatorInstance;
    FactsLookup: IRubricatorFactsLookup;
    LookupRes: Array Of Integer;
    Key: integer;
    FactD: IRubricatorFactData;
Begin
    mb := MetabaseClass.Active;
    RubObj := mb.ItemById("FC_IS_EMPTY").Edit;
    Rubr := RubObj As IRubricator;
    If Not Rubr.HasEmptyAttribute Then
        Rubr.HasEmptyAttribute := True;
        RubObj.Save;
    End If;
    RubrInst := RubObj.Open(NullAs IRubricatorInstance;
    RubrInst.RegenerateEmpty(Null);
    FactsLookup := RubrInst.CreateFactsLookup;
   FactsLookup.WhereIsDeleted := TriState.OnOption;
    LookupRes := FactsLookup.LookupFactors;
    If LookupRes <> Null Then
        For Each Key In LookupRes Do
            FactD := RubrInst.GetFactData(Key);
            Debug.WriteLine("Key = " + Key.ToString + " Empty = " + FactD.IsEmpty.ToString);
        End For;
    Else
        Debug.WriteLine("Time series are not found");
    End If;
End Sub UserProc;

After executing the example the indicator of factor emptiness is added to the time series database, and the value of this indicator is refreshed. Keys and indicators of empty deleted factors are displayed in the console window.

Fore.NET Example

Executing the example requires a time series database with the FC_IS_EMPTY identifier.

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

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    RubObj: IMetabaseObject;
    Rubr: IRubricator;
    RubrInst: IRubricatorInstance;
    FactsLookup: IRubricatorFactsLookup;
    Res: Array Of uinteger;
    LookupRes: System.Array;
    i: integer;
    Key: uinteger;
    FactD: IRubricatorFactData;
Begin
    mb := Params.Metabase;
    RubObj := mb.ItemById["FC_IS_EMPTY"].Edit();
    Rubr := RubObj As IRubricator;
    If Not Rubr.HasEmptyAttribute Then
        Rubr.HasEmptyAttribute := True;
        RubObj.Save();
    End If;
    RubrInst := RubObj.Open(NullAs IRubricatorInstance;
    RubrInst.RegenerateEmpty(Null);
    FactsLookup := RubrInst.CreateFactsLookup();
    FactsLookup.WhereIsDeleted := TriState.tsOnOption;
    LookupRes := FactsLookup.LookupFactors();
    If LookupRes <> Null Then
        For i := 0 To LookupRes.Length - 1 Do
            Key := uinteger.Parse(LookupRes[i].ToString());
            FactD := RubrInst.GetFactData(Key, DictionaryGetDataOptions.dgdoNone);
            System.Diagnostics.Debug.WriteLine("Key = " + Key.ToString + " Empty = " + FactD.IsEmpty.ToString);
        End For;
    Else
        System.Diagnostics.Debug.WriteLine("Nothing is found');
    End If;
End Sub;

After executing the example the indicator of factor emptiness is added to the time series database, and the value of this indicator is refreshed. Keys and indicators of empty deleted factors are displayed in the console window.

See also:

IRubricator