SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Eleminate or Exculde members from existing Set in MDX


Eleminate or Exculde members from existing Set in MDX

Author
Message
ravuri.vasu
ravuri.vasu
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
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]}'
MEMBER Measures.ParentNode as [Company].[Dept].CURRENTMEMBER.PARENT.UNIQUENAME
SELECT [Measures].[EmpCount] on ROWS,
{Need Trimmed Member Set Here} on COLUMNS
FROM [CUBE]

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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search