ssas - How to filter a dimension hierarchy based on another dimension hierarchy in mdx -


i have sender , recipient dimensions role playing dimensions out of employee physical table. fact table has sender, recipient ,messages columns. want messages sent employee in company except reporting manager. tried this

with    set [others]      except     (       ascendants([recipient].[manager])      ,[sender].[manager].parent     )  select    [others] on columns  ,{[measures].[messages]} on rows [cube]    [sender].[manager].&[xyz]; 

basic idea is..get ascendants of recipients of given sender , filter ascendant list consists of senders parent.

this doesn't work because can't except between 2 different dimension hierarchies.

try making set more context aware via keyword exsiting , use filter compare member_caption

with    member [measures].[sendername]      [sender].currentmember.member_caption    set [existingrecip]      (existing        [recipient].[manager].members)    set [others]      filter     (       [existingrecip]      ,         [existingrecip].item(         [existingrecip].currentordinal - 1).member_caption       <>          [measures].[sendername]     )  select    [others] on columns  ,{[measures].[messages]} on rows [cube]    [sender].[manager].&[xyz]; 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -