Step Use Cases.  

Example 1:  Apply step to data item

 

MDX Generated:

 

WITH SET [DATAITEM_DTE] AS '.[DTE].MEMBERS' 

SET [DATAITEM_CAR] AS '{[CARS].[All Cars].[Chevy], [CARS].[All Cars].[Ford]}' 

MEMBER [Measures].[SALES_SUM] AS '[Measures].[SALES_SUM]' 

SELECT CROSSJOIN({[DATAITEM_DTE]}, CROSSJOIN({[DATAITEM_CAR]}, {[Measures].[SALES_SUM]})) ON COLUMNS FROM MDDBCARS

Code to generate MDX:

 

DataItem daItem <<=== where data item is CARS

String[] memberNames = {"[CARS].[All Cars].[Chevy]","[CARS].[All Cars].[Ford]"};

DataItemMemberFilter step1 = new DataItemMemberFilter(memberNames, DataItemMemberFilter.LIST_MEMBER_FILTER_TYPE);

step1.setActionType(StepFilterInterface.INITIAL_ACTION_TYPE);

dataItem.addStep(step1);

Example 2:  Apply step to business query

 

MDX Generated:

WITH SET [&1DTE] AS '.[DTE].MEMBERS' SET [&1CARS] AS '[CARS].[CAR].MEMBERS' MEMBER [Measures].[&1SALES_SUM] AS '[Measures].[SALES_SUM]' SELECT Filter(CROSSJOIN({[&1DTE]}, CROSSJOIN({[&1CARS]}, {[Measures].[&1SALES_SUM]})),([Measures].[SALES_SUM] > 1)) ON COLUMNS FROM MDDBCARS

Code to generate MDX:

 

private ComparisonOperator operator = ComparisonOperator.COMPARE_GT;

int val = 1;

Integer vall = new Integer(val);

Object value = (Object) vall;

List memberNames = new ArrayList();

String[] dataItemUsedAsMember = {"[Measures].[SALES_SUM]"};

memberNames.add(dataItemUsedAsMember);

BusinessQueryDataBasedFilter queryStep = BusinessQueryDataBasedFilter(memberNames, operator, value);

DataSelection businessQuery  <<=== where businessQuery is the current data selection.

businessQuery.addStep(step, Role.COLUMN);