IMsAggregationFilterList.RemoveByKey

Syntax

RemoveByKey(DimKey: Integer): Boolean;

Parameters

DimKey. Key of filtered dimension.

Description

The RemoveByKey method removes filter from the collection by key of filtered dimension.

Comments

If the filter is removed successfully, the property returns True, otherwise it returns False.

Example

Executing the example requires that the repository contains a time series database with the FC identifier. The modeling container of this database must include a model with the MODEL_AGGR identifier calculated using extended aggregation method. COUNTRY is the attribute of database indicators that refers to the dictionary.

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

Sub Main;
Var
    mb: IMetabase;
    RubrDescr: IMetabaseObjectDescriptor;
    Rubr: IRubricator;
    msDescr: IMetabaseObjectDescriptor;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    Formula: IMsFormula;
    Aggr: IMsCrossDimensionAggregationTransform;
    FiltesList: IMsAggregationFilterList;
    Filter: IMsAggregationFilter;
    i: Integer;
    Attributes: IMetaAttributes;
    DictDescr: IMetabaseObjectDescriptor;
Begin
    mb := MetabaseClass.Active;
    RubrDescr := mb.ItemById("FC");
    Rubr := RubrDescr.Bind As IRubricator;
    msDescr := Rubr.ModelSpace;
    Model := mb.ItemByIdNamespace("MODEL_AGGR", msDescr.Key).Edit As IMsModel;
    Transform := Model.Transform;
    Formula := Transform.FormulaItem(0);
    Aggr := Formula.Method As IMsCrossDimensionAggregationTransform;
    FiltesList := Aggr.Filter;
    If FiltesList.Count > 0 Then
        Attributes := Rubr.Facts.Attributes;
       DictDescr := Attributes.FinById("COUNTRY").ValuesObject;
       FiltesList.RemoveByKey(DictDescr.Key);
    End If;
End Sub;

After executing the example, if the model contains filters, aggregation filter for the specified dimension is removed from the collection.

See also:

IMsAggregationFilterList

Related work items

Requirement 130645