IMsAggregationFilter.InvertSelection

Syntax

InvertSelection: Boolean;

Description

The InvertSelection property determines whether inverted selection is used in aggregation filter on calculation of modeling problem.

Comments

Available values:

The property is used only for models of the Aggregation (advanced) type.

Example

Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier containing a modeling problem with the PROBLEM identifier. The modeling problem must contain a metamodel, which calculation chain contains a model with the MODEL identifier. Set the Aggregation (advanced) type for the model on the Parameters panel and set up filter on the Specification panel.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
    
MB: IMetabase;
    RubrDescr, Descr: IMetabaseObjectDescriptor;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    Formula: IMsFormula;
    FilterList: IMsAggregationFilterList;
    Filter: IMsAggregationFilter;
    Problem: IMsProblem;
    Settings: IMsProblemCalculationSettings;
    Calc: IMsProblemCalculation;
    Aggr: IMsCrossDimensionAggregationTransform;
    Method: IMsMethod;
Begin
    MB := MetabaseClass.Active;
    
// Get modeling container
    RubrDescr := MB.ItemById("CONT_MODEL");
    Descr := RubrDescr.EditDescriptor;
    
// Get model
    Model := MB.ItemByIdNamespace("MODEL", Descr.Key).Edit As IMsModel;
    
// Get modeling problem
    Problem := MB.ItemByIdNamespace("PROBLEM", Descr.Key).EditTemporary As IMsProblem;
    
// Get model parameters
    Transform := Model.Transform;
    
// Get model calculation method
    Formula := Transform.FormulaItem(0);
    
// Get model calculation method parameters
    Method := Formula.Method;
    Aggr := Method 
As IMsCrossDimensionAggregationTransform;
    
// Get aggregation filters
    FilterList := Aggr.Filter;
    
// Invert selection for the first filter
    Filter := FilterList.Item(0);
    Filter.InvertSelection := 
True;
    
// Save changes
    (Model As IMetabaseObject).Save;
    
// Calculate modeling problem
    Settings := Problem.CreateCalculationSettings;
    Calc := Problem.Calculate(Settings);
    
Calc.Run;
End Sub UserProc;

After executing the example the modeling problem, the metamodel contained in it, and the model are calculated. Aggregation by the specified filter is executed on model calculation. Aggregation is executed by the inverted selection for the first filter dimension.

See also:

IMsAggregationFilter