IStandardCubeDimension.QueryStrategy

Syntax

QueryStrategy: ICubeDimensionQueryStrategy;

Description

The QueryStrategy property returns parameters of filtering strategies by this cube dimension.

Comments

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.

Example

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.

See also:

IStandardCubeDimension