QueryStrategy: ICubeDimensionQueryStrategy;
QueryStrategy: Prognoz.Platform.Interop.Cubes.ICubeDimensionQueryStrategy;
The QueryStrategy property returns parameters of filtering strategies by this cube dimension.
Filtering strategy determines how a data extraction query is created depending on dimension selection. For details about creating a data extraction query depending on the selected filtering strategy see the Cube Dimensions: Dimension Properties subsection.
Executing the example requires a standard cube with the STD_CUBE identifier. Add links to the Cubes and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Cube: IStandardCube;
Dims: IStandardCubeDimensions;
Dim: IStandardCubeDimension;
Strategy: ICubeDimensionQueryStrategy;
Begin
Mb := MetabaseClass.Active;
Cube := MB.ItemById("STD_CUBE").Edit As IStandardCube;
//Do not use subqueries on data extraction from first data source
Cube.Datasets.Item(0).UseSubqueryOptimization := False;
//Set up filtering strategies for all dimensions
Dims := Cube.Dimensions;
For Each Dim In Dims Do
Strategy := Dim.QueryStrategy;
//Filter depending on the number of selected elements and use time table
Strategy.FilterMethod := CubeDimensionFilterMethod.QuantityBasedUseTempTable;
//Number of elements, depending on which query is modified
Strategy.RatioOrQuantity := 5;
End For;
(Cube As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the strategy of filtering by all dimensions is changed in the cube. Element filtering method is changed depending on the number of selection elements, filtering method change threshold is 5 elements. In addition, if a query is created for the first data source, subqueries are not used.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Cube: IStandardCube;
Dims: IStandardCubeDimensions;
Dim: IStandardCubeDimension;
Strategy: ICubeDimensionQueryStrategy;
Begin
Mb := Params.Metabase;
Cube := MB.ItemById["STD_CUBE"].Edit() As IStandardCube;
//Do not use subqueries on data extraction from first data source
Cube.Datasets.Item[0].UseSubqueryOptimization := False;
//Set up filtering strategies for all dimensions
Dims := Cube.Dimensions;
For Each Dim In Dims Do
Strategy := Dim.QueryStrategy;
//Filter depending on the number of selected elements and use time table
Strategy.FilterMethod := CubeDimensionFilterMethod.dfmQuantityBasedUseTempTable;
//Number of elements, depending on which query is modified
Strategy.RatioOrQuantity := 5;
End For;
(Cube As IMetabaseObject).Save();
End Sub;
See also: