AggregatorFilter(DimInst: IDimInstance): IMsAggregationFilter;
DimInst. Dictionary data.
The AggregatorFilter property returns the data consumer dimension filtering settings.
Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier and a standard cube with the CUBE identifier. The calculation algorithm should contain an aggregation block, the cube should contain a dimension with the DIMENSIONS identifier.
Add links to the Algo, Cubes, Dimensions, Metabase, Ms system assemblies. Add links to the assemblies required for working with calculation algorithms.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObjectDescriptor;
Algo, Aggr: ICalcObject;
List: ICalcObjectsList;
CalcAlgo: ICalcAlgorithm;
Block: ICalcAggr;
Stub: IVariableStub;
StandCub: IStandardCube;
Dim: IStandardCubeDimension;
DimInst: IDimInstance;
Filter: IMsAggregationFilter;
Selection: IDimSelection;
i: Integer;
Begin
MB := MetabaseClass.Active;
// Get calculation algorithm
MObj := MB.ItemById("ALGORITHM");
Algo := CalcObjectFactory.CreateCalcObject(MObj, True);
CalcAlgo := Algo As ICalcAlgorithm;
// Get list of calculation algorithm objects
List := CalcAlgo.Items;
// Get aggregation block with the 0 index
Aggr := List.Item(0);
Block := Aggr As ICalcAggr;
// Get cube
StandCub := MB.ItemById("CUBE").Edit As IStandardCube;
Stub := StandCub As IVariableStub;
// Set cube as data consumer
Block.Stub := Stub;
// Set up filtering for specified dimension
Dim := StandCub.Dimensions.FindById("DIMENSIONS");
DimInst := Dim.OpenDimension;
Filter := Block.AggregatorFilter(DimInst);
// Set dimension selection
Selection := DimInst.CreateSelection;
For i := 0 To 4 Do
Selection.SelectElement(i, False);
End For;
Filter.AggregationSelection := Selection;
Block.SelectionControl.Apply;
// Save changes in aggregation block
Block.SaveObject;
End Sub UserProc;
After executing the example, a standard cube is set for aggregation block as a data consumer, and data filtering is set up by first selected elements for the dimension with the DIMENSIONS identifier.
See also: