MDX Calculated Member CrossJoin question
Asked Answered
R

1

12

I have an MDX query with the following calculated member:

with member [Measures].[BBOX] as
Count(
    Filter(
        CrossJoin([Dim Response].[Response ID].Children, [Dim Question].[Question Text].Children),
        [Measures].[Question Bottom Box] > 0
    )
)

The idea is that I want a count of the combinations of two members of a dimension. (Forgive me if my MDX vocabulary is a little off). It is also based on some criteria.

The rest of the query looks like this:

select 
{({[Measures].[TBOX], [Measures].[BBOX]}, 
[Dim Product].[Category Name].&[Office])} on columns,
{[Dim Question].[Question Text].Members} on rows 
from H1_FY10_Revised
where ({[Dim Question].[Category Name].&[Partner]}, 
{[Dim Subsidiary].[Subsidiary Alias Name].&[Germany]})

My question is: does the slicing of data that occurs in the main query (the where clause) translate to the calculated member? Is there any sort of implicit join between the data that comes back from the calculated member and the axises in the main query?

Or another way to phrase it: does the cross join in the calculated member execute in the context of the main query?

Retinoscopy answered 14/1, 2010 at 19:44 Comment(4)
I feel silly now. I believe I found the problem. The way to kind of include the context of the query is to use .CurrentMember instead of .Member or .Children. That way I'm getting the appropriate member in the context of the query. Ah MDX ...Retinoscopy
You should post that as an answer below.Stenotypy
Ryan, post your comment as an anwser in order to check it as solution.Metonym
@Ryan, If you are every going to you should answer this question now, while the bounty is still up for grabsTetryl
M
3

The evaluation of the CrossJoin does not depend on the context, but the Filter function does.

Calculated members are evaluated in the context of the query bu your calculated member may have a constant value because:

  • [Dim Response].[Response ID].Children is equivalent to [Dim Response].[Response ID].DefaultMember.Children (see MSDN).
  • [Dim Question].[Question Text].Children is equivalent to [Dim Question].[Question Text].DefaultMember.Children

So the result of the CrossJoin does not depend on the slicer. Only the value of [Measures].[Question Bottom Box] will depend on the slicer.

Microhenry answered 20/11, 2012 at 21:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.