IMsMetaAttributeValues.ParameterAsSelection

Syntax

ParameterAsSelection: IMsModelParam;

Description

The ParameterAsSelection property determines the parameter used to transfer the element selection used for validation calculation.

Comments

To set the parameter value, use the IValidationExecuteSettings.ParamValues property.

Example

Executing the example requires a form, containing the LanerBox component with the LanerBox1 identifier and the UiErAnalayzer component with the UiErAnalyzer1 identifier. UiErAnalyzer1 is a data source for LanerBox1 and contains loaded workbook of the time series database with the TSDB_70 identifier. Database parameters:

Add links to the Metabase, Ms, Cubes, Rds system assemblies.

The example is the function for adding a parameter to the validation filter. The parameter limits the filtered series set. Function input parameters:

Sub AddFilterParam(IsGroup: Boolean; Value: Variant);
Var
    mb: IMetabase;
    FCObj: IMetabaseObject;
    FC: IRubricator;
    Atts: IMetaAttributes;
    LinkedDict: IMetabaseObjectDescriptor;
    ValidObj: IMetabaseObject;
    ValidFilter: IValidationFilter;
    Params: IMsModelParams;
    FilterPrarm: IMsModelParam;
    Filter: IMsMetaAttributeFilter;
    FilterVal: IMsMetaAttributeValues;
    ExecSett: IValidationExecuteSettings;
    Analyzer: IEaxAnalyzer;
    ParamVals: IMsModelParamValues;
    ExecRun: IValidationExecRun;
    DiagRep: IDiagnosticReport;
Begin
    mb := MetabaseClass.Active;
    // Get time series database
    FCObj := mb.ItemById("TSDB_70").Bind;
    FC := FCObj As IRubricator;
    //Get dictionary, to which the COUNTRY attribute refers
    Atts := FC.GetDictionary(RubricatorDictionary.Facts).Attributes;
    LinkedDict := Atts.FindById("COUNTRY").ValuesObject;
    //Get validation filter
    ValidObj := Mb.ItemByIdNamespace("VALIDATION_FILTER", FCObj.Key).Edit;
    ValidFilter := ValidObj As IValidationFilter;
    // Get validation filter parameters
    Params := ValidFilter.Params;
    Params.Clear;
    // Add parameter for elements filtering
    FilterPrarm := Params.Add;
    FilterPrarm.Id := "FILTER_COUNTRY";
    FilterPrarm.Name := "Country for filter";
    FilterPrarm.LinkedObject := LinkedDict;
    // Set validation filter
    Filter := (ValidFilter.Details As IValidationTrend).Filter;
    Filter.Clear;
    FilterVal := Filter.Add(Atts.FindById("COUNTRY"));
    If IsGroup Then
        FilterVal.ParameterAsGroup := FilterPrarm;
    Else
        FilterVal.ParameterAsSelection := FilterPrarm;
    End If;
    // Save validation filter
    ValidObj.Save;
    // Set filter execution parameters
    ExecSett := ValidFilter.CreateExecuteSettings;
    Analyzer := UiErAnalyzer1.ErAnalyzer;
    ExecSett.Laner := Analyzer.Laner;
    // Set parameter values
    ParamVals := ExecSett.ParamValues;
    ParamVals.FindById("FILTER_COUNTRY").Value := Value;
    // Execute validation filter
    ExecRun := ValidFilter.Execute(ExecSett);
    DiagRep := New DiagnosticReport.Create;
    DiagRep.Run := ExecRun;
    DiagRep.EaxAnalyzer := Analyzer;
End Sub AddFilterParam;

Example execution result: for the VALIDATION_FILTER validation filter series set, for which the filter is executed, is changed. Filtered series are set by the COMPAR_COUNTRY parameter determining value of the COUNTRY mandatory attribute. The filter is executed for the workbook displayed in LanerBox1.

See also:

IMsMetaAttributeValues