MoveTo(FromIndex: Integer; ToIndex: Integer);
FromIndex. Index of position of the filter that must be moved.
ToIndex. Index of the position, to which the filter must be moved.
The MoveTo method moves filter in the collection.
Executing the example requires that the repository contains a time series database with the FC identifier. A modeling container of this database must include a model with the MODEL_AGGR identifier calculated using extended aggregation method.
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;
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;
If FiltesList.Count > 1 Then
FiltesList.MoveTo(0, FiltesList.Count - 1);
End If;
(Model As IMetabaseObject).Save;
End Sub;
After executing the example, if the model contains filters, the first aggregation filter will be moved to the end of the collection.
See also: