HasEmptyAttribute: Boolean;
HasEmptyAttribute: boolean;
The HasEmptyAttribute property determines whether factors are empty in a time series database.
Factor emptiness indicator depends on the value of the Empty factors attribute (the EMPT identifier).
Available values of HasEmptyAttribute:
True. The database contains the Empty factors attribute.
False. Default value. The database does not contain the Empty factors attribute.
If all the values of the factor in database on actual revision are empty (absent or equal to Null), it is set as empty. A new factor is considered as empty until data is not saved to it.
To update emptiness indicator of factor, use the IRubricatorInstance.RegenerateEmpty method.
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(Null) As IRubricatorInstance;
RubrInst.RegenerateEmpty(Null);
FactsLookup := RubrInst.CreateFactsLookup;
FactsLookup.WhereIsEmpty := TriState.OnOption;
LookupRes := FactsLookup.LookupFactors;
If LookupRes <> Null Then
For Each Key In LookupRes Do
FactD := RubrInst.GetFactData(Key);
Debug.WriteLine(Key = + Key.ToString + Mnemonic = + FactD.Mnemo);
End For;
Else
Debug.WriteLine(Time series are not found);
End If;
End Sub UserProc;
After executing the example the indicator of time series emptiness is added to the time series database, and the value of this indicator is refreshed. Keys and mnemonics of empty factors are displayed in the console window.
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(Null) As IRubricatorInstance;
RubrInst.RegenerateEmpty(Null);
FactsLookup := RubrInst.CreateFactsLookup();
FactsLookup.WhereIsEmpty := 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() + Mnemonic = + FactD.Mnemo);
End For;
Else
System.Diagnostics.Debug.WriteLine(Nothing is found);
End If;
End Sub;
After executing the example the indicator of time series emptiness is added to the time series database, and the value of this indicator is refreshed. Keys and mnemonics of empty factors are displayed in the console window.
See also: