Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Eleminate or Exculde members from existing Set in MDX Expand / Collapse
Posted Wednesday, February 20, 2013 12:44 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 21, 2013 4:35 AM
Points: 1, Visits: 10
Hello All,

I need an MDX to eliminate some of the members in existing set, my scenario is as below

I have dimension which has n-level parent child hierarchy and I am using that dimension in PPS dashboard. When user selects all children along with the parent then I should not display children and i should only display parent and this is applicable for any level.

Below is the example, assuming that Company is my dimension and it has HR and Finance departments and sub-departments under the main departments (I added primary key of each dept in Parenthesis) .

Company (1)
------------HR (2)
------------------HR Sub 1 (3)
------------------HR Sub 2 (4)
------------Finance (5)
------------------Finance Sub 1 (6)
------------------Finance Sub 2 (7)
I am using the above dimension as "Multi Select Tree" in my PPS so user can select HR, HR Sub 1, HR Sub 2 at a time. When selects all child under parent then I need to exclude the children.

Below is the logic to achieve it

First get parent for each member and if the member parent is exists in the selected set then ignore that member. To achieve this I wrote a MDX and I am able to find the Parent of each member but I don’t know how to check whether the parent exists in the set or not.

below is the MDX I wrote

WITH SET DeptSet AS '{[Company].[Dept].&[2], [Company].[Dept].&[3],[Company].[Dept].&[4], [Company].[Dept].&[6]}'
SELECT [Measures].[EmpCount] on ROWS,
{Need Trimmed Member Set Here} on COLUMNS

In the above MDX "DeptSet" is the set which I receive from PPS and after implementing the above logic I need to get the set as below

{[Company].[Dept].&[2], [Company].[Dept].&[6]}

Thanks in advance.
Post #1421953
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse