Search code examples
mdx

MDX - how to exclude certain members in mdx


i'm wondering how to exclude certain members from one dimension that have links with other members from another dimension ... let's say i want to exclude clients (dim_clients) that have a status A OR a status B (dim_status). I know how to crossjoin the two dimensions to obtain those clients but i can't figure out how to exclude them from my calculation since the EXCEPT function accepts two sets from same dimensionality but the ones i want to exclude are the result of a crossjoin operation, i can't use the except function

i want something like this :

SELECT Measure.MyMeasure ON 0 
FROM MyCUBE 
WHERE 
EXCEPT([DIM CLIENTS].[Clients], [EXCLUDED CLIENTS])

Thanks


Solution

  • SELECT Measure.MyMeasure ON 0
    FROM MyCUBE
    WHERE
    EXCEPT([DIM CLIENTS].[Clients], Filter({[DIM CLIENTS].[Clients]},[DIM_STATUS].CurrentMember IS [DIM_STATUS].statusA OR [DIM_STATUS].CurrentMember IS [DIM_STATUS].statusA))
    

    I am not too sure what [Clients] is. I would use Members though.