Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MDX Calculated Member CrossJoin question

Tags:

olap

cubes

mdx

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?

like image 754
Ryan Avatar asked Jan 14 '10 19:01

Ryan


1 Answers

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.

like image 85
Benoit Avatar answered Dec 09 '22 15:12

Benoit