Clear(Mode: CubeLoadClearMode; Lookup: IRubricatorDictionaryLookup; FactsAttrs: String; ValuesAttrs: String);
Mode. The mode of clearing time series database.
Lookup. Parameters of selecting series to be cleared.
FactsAttrs. The list of series attributes with values cleared for the selected series.
ValuesAttrs. The list of the observation attributes, which values will be cleared for the selected series.
The Clear method clears the series in the time series database according to the specified parameters.
As the value of the Mode parameter it is necessary to specify some value except for CubeLoadClearMode.Default_. The clearing in the selected mode is executed for the series, which will be selected according to the conditions specified in the Lookup parameter. On clearing metadata of the series in the FactsAttrs and ValuesAttrs parameters, specify identifiers of series and observation attributes, which values will be reset. Identifiers in lists are divided by the ; character. If it is necessary to reset values of all attributes, specify * character in the required list.
When the method is worked, the possibility of resetting the value by the attribute is checked. 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 OBJ_RUBRICATOR identifier. The list of factors attribute includes three additional attributes: COUNTRY, ATTR1 and ATTR2.
Sub UserProc;
Var
MB: IMetabase;
RubInstance: IRubricatorInstance;
Lookup: IRubricatorFactsLookup;
MetaDLookup: IMetaDictionaryLookup;
Cond: IOrmCondition;
Begin
MB := MetabaseClass.Active;
RubInstance := MB.ItemById("OBJ_RUBRICATOR").Open(Null) As IRubricatorInstance;
Lookup := RubInstance.CreateFactsLookup;
MetaDLookup := Lookup.Lookup;
Cond := MetaDLookup.Where.Add;
Cond.AttributeName := "COUNTRY";
Cond.Value := 512;
RubInstance.Clear(CubeLoadClearMode.MetadataOnly, Lookup, "ATTR1; ATTR2", "*");
End Sub UserProc;
On executing the example the metadata of series of the specified time series database will be cleared: for all series, which have the value of the COUNTRY attribute equal to 512 the factor attributes ATTR1 and ATTR2, and all observation attributes will be reset.
See also: