Data Item Member Filter Use Cases.

Exampl e 1: Member filter is applied using a list of members [CARS].[All Cars].[Chevy] [CARS].[All Cars].[Chrysler]

> MDX Generated:

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

> > SET [DATAITEM_CAR] AS '{[CARS].[All Cars].[Chevy]:[CARS].[All Cars].[Toyota]}'

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

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

> Sample Code to use:

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

> > DataItemMemberFilter step = new DataItemMemberFilter(memberNames, DataItemMemberFilter.LIST_MEMBER_FILTER_TYPE);

> > dataItem.addStep(step); <<=== where dataItem is CARS dimension

Example 2: Testing member filter is applied using a range of members ROW - [CARS].[All Cars].[Chevy] [CARS].[All Cars].[Toyota]

> MDX Generated:

> > WITH SET [DTE] AS '[DATE].[DTE].MEMBERS'

> > SET [DATAITEM_CAR] AS '{[CARS].[All Cars].[Chevy]:[CARS].[All Cars].[Toyota]}'

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

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

> Sample Code to use:

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

> DataItemMemberFilter step = new DataItemMemberFilter(memberNames, DataItemMemberFilter.RANGE_MEMBER_FILTER_TYPE);

> dataItem.addStep(step); <<=== where dataItem is CARS dimension

Example 4: Testing member filter is applied using a range of members ROW - starting at [CARS].[All Cars].[Chevy] to the last member.

> MDX Generated:

> > WITH SET [DTE] AS '[DATE].[DTE].MEMBERS'

> > SET [DATAITEM_CAR] AS '{[CARS].[All Cars].[Chevy]:[CARS].[All Cars].LASTSIBLING}'

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

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

> Sample Code to use:

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

> DataItemMemberFilter step = new DataItemMemberFilter(memberNames, DataItemMemberFilter.RANGE_MEMBER_FILTER_TYPE);

> dataItem.addStep(step); <<=== where dataItem is CARS dimension