AggregationGroup: IDimElementGroup ;
The AggregationGroup property determines the group, by which aggregation is executed. The values of the IMsAggregationFilter.AggregationSelection and the IMsAggregationFilter.AggregationParamID properties are reset if the value is set for this property.
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. COUNTRY is the attribute of time series database that refers to the dictionary. SOUTH_AMERICA is a group of elements of this dictionary.
Add links to the Metabase, Ms, Cubes, Dimensions, Rds system assemblies.
Sub UserProc;
Var
Group: IDimElementGroup;
mb: IMetabase;
RubrDescr: IMetabaseObjectDescriptor;
Rubr: IRubricator;
msDescr: IMetabaseObjectDescriptor;
Model: IMsModel;
Transform: IMsFormulaTransform;
Formula: IMsFormula;
Aggr: IMsCrossDimensionAggregationTransform;
FiltesList: IMsAggregationFilterList;
Filter: IMsAggregationFilter;
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;
Attributes := Rubr.Facts.Attributes;
DictDescr := Attributes.FindById("COUNTRY").ValuesObject;
Filter := FiltesList.Add(DictDescr.Bind As IDimensionModel);
Group := Mb.ItemByIdNamespace("SOUTH_AMERICA", DictDescr.Key).Bind As IDimElementGroup;
Filter.AggregationGroup := Group;
Debug.WriteLine(AGGREGATION FILTER);
Debug.WriteLine(" Filter name: " + Filter.Name);
Debug.WriteLine(" Filter mark: " + Group.Selection.ToString);
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example a new filter is added to the extended aggregation model: aggregation is calculated only for elements of the SOUTH_AMERICA group. Then the information about this filter is displayed in the console window.
See also: