none
one question about the book solution MDX. RRS feed

  • Question

  • In the page of 406, it uses the following scope, My question is : Is the code highlighted required? If we don't code a dimension explicitly, then the defaultmember will be used, so should they are the same if we don't put the highlighted code?

       ( [Period].[Year-Month Period Calculations].[Twelve Months to Date],
                   [Period].[Month].[Month].Members ) =
         Aggregate(
                       { [Period].[Year-Month Period Calculations].DefaultMember }  *
                       {
                        ParallelPeriod(
                                           [Period].[Year-Month].[Month],
                                           11,
                                           [Period].[Year-Month].CurrentMember
                        ) : [Period].[Year-Month].CurrentMember
                       }
         ) ;

    Friday, October 14, 2011 5:58 AM

Answers

  • "..doesn't that mean it will use the defaultmember of it" - no, it doesn't, because it is constrained by the subcube on the LHS, as I mentioned previously. If the  [Period].[Year-Month Period Calculations] attribute wasn't constrained on the LHS of the assignement, then it would use the default member on the RHS.
    - Deepak

    Thursday, October 20, 2011 1:24 AM
    Moderator

All replies

  • What is the full title and edition of the MDX book you're referring to? I think that you're correct if there's no outer scope() surrounding this assignment, which could change the current member from the default.
    - Deepak
    Friday, October 14, 2011 6:40 AM
    Moderator
  • it is :
    MDX Solutions: With Microsoft SQL Server Analysis Services 2005 and Hyperion Essbase

    http://www.amazon.com/MDX-Solutions-Microsoft-Analysis-Services/dp/0471748080/ref=sr_1_1?ie=UTF8&qid=1318574577&sr=8-1

    So they are the same?
    Friday, October 14, 2011 6:44 AM
  • Based on a similar example, the constrained subcube on the left-hand side changes the context of the right hand side as well - so they aren't the same and you need to explicitly reset the context to the default member as in the book.


    - Deepak
    • Marked as answer by Daniel Wu Saturday, October 15, 2011 1:42 PM
    • Unmarked as answer by Daniel Wu Tuesday, October 18, 2011 6:35 AM
    Friday, October 14, 2011 7:12 AM
    Moderator
  • If we don't add the code of

    [Period].[Year-Month Period Calculations].DefaultMember }

    Then that dimension is not appear in the axis in the right part, doesn't that mean it will use the defaultmember of it, so adding the code or doesn't matter?

    Tuesday, October 18, 2011 6:38 AM
  • "..doesn't that mean it will use the defaultmember of it" - no, it doesn't, because it is constrained by the subcube on the LHS, as I mentioned previously. If the  [Period].[Year-Month Period Calculations] attribute wasn't constrained on the LHS of the assignement, then it would use the default member on the RHS.
    - Deepak

    Thursday, October 20, 2011 1:24 AM
    Moderator