ClearEx(
Mode: CubeLoadClearMode;
FactorKeys: Array;
FactsAttrs: String;
ValuesAttrs: String;
[ExtraOptions: CubeClearOptions = 0]);
Mode. The mode of clearing time series database.
FactorKeys. The array of time series keys that must be cleared.
FactsAttrs. Series attributes to be cleared.
ValuesAttrs. Observation attributes to be cleared.
ExtraOptions. Additional parameters of time series database clearing.
The ClearEx method clears the time series database according to the specified advanced parameters.
On working with the method consider aspects of specifying the following parameters:
Mode. The parameter can take any value except for CubeLoadClearMode.Default_.
FactsAttrs, ValuesAttrs. Specify identifiers of series and observations with values to be cleared. If it is necessary to clear values of more than one attribute, attribute identifiers are separated by the ";" character. If it is necessary to clear values of all attributes, specify the "*" character.
When working the method checks the capability of clearing the attribute: if some attribute cannot have empty values, its values will not be reset.
Executing the example requires that the repository contains a time series database with the TSDB identifier. This database must contain the following series attributes: "COUNTRY" that is a link on the dictionary, and the "NOTES" string attribute.
Add links to the Cubes, Dimensions, Metabase, Orm, Rds system assemblies.
Sub UserProc;
Var
MB: IMetabase;
RubInstance: IRubricatorInstance;
Lookup: IRubricatorFactsLookup;
MetaDLookup: IMetaDictionaryLookup;
Cond: IOrmCondition;
FactorKeys: Array Of Integer;
Begin
MB := MetabaseClass.Active;
// Get instance of time series database
RubInstance := MB.ItemById("TSDB").Open(Null) As IRubricatorInstance;
// Create an object to search in time series database
Lookup := RubInstance.CreateFactsLookup;
MetaDLookup := Lookup.Lookup;
Cond := MetaDLookup.Where.Add;
// Specify that search is executed to those time series,
// that have the COUNTRY attribute with the 512 value
Cond.AttributeName := "COUNTRY";
Cond.Value := 512;
// Search and get keys of time series that are found
MetaDLookup.Open(DictionaryCursorOptions.None);
FactorKeys := MetaDLookup.LookupKeys("KEY");
MetaDLookup.Close;
// Clear time series database
RubInstance.ClearEx(CubeLoadClearMode.MetadataOnly, FactorKeys, "NOTES", "*", CubeClearOptions.NoCreateRevision);
End Sub UserProc;
After executing the example, the time series database has been cleared without creating a new revision: metadata of the NOTES series attributes and all observation attributes are cleared for all time series that have the value of the COUNTRY attribute equal to 512.
See also: