ComparisonType: ValidationRevisionComparisonType;
ComparisonType: Prognoz.Platform.Interop.Ms.ValidationRevisionComparisonType;
The ComparisonType property determines the type of value change.
Series values can be checked for presence or absence of changes, for adding or deleting of values and for their increasing or decreasing.
Executing the example requires that the repository contains the TSDB_VALIDATION_PARAMETERS time series database containing a validation rule with the VALIDATION identifier.
Add links to the Dimensions, Metabase, Ms system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
RubrObj, ValObj: IMetabaseObjectDescriptor;
ValFilter: IValidationFilter;
ComponentMismatch: IValidationComponentMismatch;
ComparisonValue: IValidationComparisonValue;
Begin
Mb := MetabaseClass.Active;
// Get time series database
RubrObj := Mb.ItemById("TSDB_VALIDATION_PARAMETERS");
// Get validation rule
ValObj := Mb.ItemByIdNamespace("VALIDATION", RubrObj.Key).Edit;
ValFilter := ValObj As IValidationFilter;
// Specify that validation is executed by all levels of calendar frequency
ValFilter.Level := DimCalendarLevel.None;
// Specify validation type
ValFilter.Kind := ValidationDetailsKind.ComponentMismatch;
// Get the Components Deviation Analysis validation parameters
ComponentMismatch := ValFilter.Details As IValidationComponentMismatch;
// Set parameters of comparing the source and output series
ComponentMismatch.ComparisonType := ValidationRevisionComparisonType.Change;
ComparisonValue := ComponentMismatch.ComparisonValue;
ComparisonValue.ComparisonOperator := ValidationComparisonOperator.More;
ComparisonValue.Value1 := 5;
ComparisonValue.Percentage := True;
// Clear execution area and validation filter
ComponentMismatch.SelectionTargetData.Clear;
ComponentMismatch.SelectionFilter.Clear;
// Save the rule
(ValObj As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the Components Deviation Analysis validation rule is set up: series which value of change is more than five percents are detected.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Ms;
…
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
RubrObj, ValObj: IMetabaseObjectDescriptor;
ValFilter: IValidationFilter;
ComponentMismatch: IValidationComponentMismatch;
ComparisonValue: IValidationComparisonValue;
Begin
Mb := Params.Metabase;
// Get time series database
RubrObj := Mb.ItemById["TSDB_VALIDATION_PARAMETERS"];
// Get validation rule
ValObj := Mb.ItemByIdNamespace["VALIDATION", RubrObj.Key].Edit();
ValFilter := ValObj As IValidationFilter;
// Specify that validation is executed by all levels of calendar frequency
ValFilter.Level := DimCalendarLevel.dclNone;
// Specify validation type
ValFilter.Kind := ValidationDetailsKind.vdkComponentMismatch;
// Get the Components Deviation Analysis validation parameters
ComponentMismatch := ValFilter.Details As IValidationComponentMismatch;
// Set parameters of comparing the source and output series
ComponentMismatch.ComparisonType := ValidationRevisionComparisonType.vrctChange;
ComparisonValue := ComponentMismatch.ComparisonValue;
ComparisonValue.ComparisonOperator := ValidationComparisonOperator.vcoMore;
ComparisonValue.Value1 := 5;
ComparisonValue.Percentage := True;
// Clear execution area and validation filter
ComponentMismatch.SelectionTargetData.Clear();
ComponentMismatch.SelectionFilter.Clear();
// Save the rule
(ValObj As IMetabaseObject).Save();
End Sub;
See also: