IValidationGrowthRate.ComparisonValue

Syntax

ComparisonValue: IValidationComparisonValue;

Description

The ComparisonValue property returns growth rate parameters.

Comments

Growth rate values can be absolute or percentage. To select value type, use the IValidationComparisonValue.Percentage property.

Example

Executing the example requires that the repository contains a time series database with the TSDB_VALIDATION_PARAMETERS identifier containing a validation rule with the VALIDATION identifier.

Add links to the Dimensions, Metabase, Ms system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    RubrKey: Integer;
    ValidObj: IMetabaseObject;
    ValidFilter: IValidationFilter;
    GrowthRate: IValidationGrowthRate;
    ComparisonValue: IValidationComparisonValue;
Begin
    Mb := MetabaseClass.Active;
    // Get validation rule
    RubrKey := Mb.GetObjectKeyById("TSDB_VALIDATION_PARAMETERS");
    ValidObj := Mb.ItemByIdNamespace("VALIDATION", RubrKey).Edit;
    ValidFilter := ValidObj As IValidationFilter;
    // Set frequency level to which rule is applied
    ValidFilter.Level := DimCalendarLevel.None;
    // Specify validation type
    ValidFilter.Kind := ValidationDetailsKind.GrowthRate;
    // Get parameters of the Growth Rate Analysis rule
    GrowthRate := ValidFilter.Details As IValidationGrowthRate;
    // Set calculation parameters of growth rate
    ComparisonValue := GrowthRate.ComparisonValue;
    ComparisonValue.ComparisonOperator := ValidationComparisonOperator.Less;
    ComparisonValue.Percentage := True;
    ComparisonValue.Value1 := 10;
    // Clear execution area and validation filter
    GrowthRate.SelectionTargetData.Clear;
    GrowthRate.SelectionFilter.Clear;
    // Save the rule
    ValidObj.Save;
End Sub UserProc;

After executing the example the Growth Rate Analysis validation is set up: series values with growth rate less than 10% are detected.

See also:

IValidationGrowthRate