IMsMetaAttributeValueList.ScenarioKey

Syntax

ScenarioKey: Integer;

Description

The ScenarioKey property determines the scenario key, by which validation should be calculated.

Comments

By default the ScenarioKey takes value -1, that is, validation is calculated based on actual data (the Fact scenario).

The calculation on scenario data is available for validations working with data and not metadata.

Supported validation types

Example

Executing the example requires a form, a button named Button1 on it, the LanerBox component and the UiErAnalyzer component named UiErAnalyzer1 that is a data source for LanerBox. Workspace of the OBJ_FC time series database must be loaded to UiErAnalyzer1. The time series database should contain a validation filter of the Compare with Number type with the OBJ_VALID_FILTER identifier.

Add links to the Metabase, Ms, Cubes, Rds system assemblies. This example is the OnClick event handler for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);;
Var
    Mb: IMetabase;
    RubrKey: Integer;
    ValidObj: IMetabaseObject;
    ValidFilter: IValidationFilter;
    Level: IValidationLevel;
    ComparisonValue: IValidationComparisonValue;
    ValidExecSett: IValidationExecuteSettings;
    ValidExecRun: IValidationExecRun;
    DiagRep: IDiagnosticReport;
    MetaAttrValList: IMsMetaAttributeValueList;
    Rub: IRubricator;
    Analyzer: IEaxAnalyzer;
Begin
    Mb := MetabaseClass.Active;
    RubrKey := Mb.GetObjectKeyById("OBJ_FC");
    ValidObj := Mb.ItemByIdNamespace("OBJ_VALID_FILTER", RubrKey).Edit;
    ValidFilter := ValidObj As IValidationFilter;
    ValidFilter.Kind := ValidationDetailsKind.Level;
    Level := ValidFilter.Details As IValidationLevel;
    ComparisonValue := Level.ComparisonValue;
    ComparisonValue.ComparisonOperator := ValidationComparisonOperator.More;
    ComparisonValue.Percentage := False;
    ComparisonValue.Value1 := -0.3;
    Rub := Mb.ItemById("OBJ_FC").Bind As IRubricator;
    MetaAttrValList := Level.TargetData;
    MetaAttrValList.ScenarioKey := 1;
    ValidObj.Save;
    ValidExecSett := New ValidationExecuteSettings.Create;
    Analyzer := UiErAnalyzer1.ErAnalyzer;
    ValidExecSett.Laner := Analyzer.Laner;
    ValidExecRun := ValidFilter.Execute(ValidExecSett);
    DiagRep := New DiagnosticReport.Create;
    DiagRep.Run := ValidExecRun;
    DiagRep.EaxAnalyzer := Analyzer;
End Sub Button1OnClick;

After executing the example the Compare with Number validation filter is adjusted: series scenario data greater than -0.3 is filtered (scenario key 1). This filter is applied to the loaded workspace.

See also:

IMsMetaAttributeValueList