FindById(DimKey: Integer): IMsAggregationFilter;
DimKey. Key of filtered dimension.
The FindByKey method searches for filter in the collection by key of filtered dimension.
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;
FilterDimension: IMetabaseObject;
DimInst: IDimInstance;
Selection: IDimSelection;
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;
Attributes := Rubr.Facts.Attributes;
DictDescr := Attributes.FindById("COUNTRY").ValuesObject;
Filter := FiltesList.FindByKey(DictDescr.Key);
If Filter <> Null Then
Debug.WriteLine(" Filter name: " + Filter.Name);
Debug.WriteLine(" Filter selection: " + Filter.AggregationSelection.ToString);
End If;
End Sub;
After executing the example aggregation filter is searched in the model collection by key of filtered dimension. If the filter is found, the information about it is displayed in the console window.
See also:
Related work items
Requirement 130645