none
are they the same (two MDX). RRS feed

  • Question

  • are the following 2 the same?

    [FEEDBACKDESC].[FEEDBACKDESC].[FEEDBACKDESC]

     

    [FEEDBACKDESC].[FEEDBACKDESC].ALL.Children

    Friday, July 8, 2011 1:42 AM

Answers

  • All are same.

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].[Sales Reason] ON 1

    from

    [Adventure Works]

     

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].[All Sales Reasons].CHILDREN ON 1

    from

    [Adventure Works]

     

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].CHILDREN ON 1

    from

    [Adventure Works]


    vinu
    • Marked as answer by Daniel Wu Friday, July 8, 2011 5:38 AM
    Friday, July 8, 2011 2:06 AM
  • Hi Daniel,

    The two will return the same results in most cases. Mind you, the first one is equivalent to:

    [FEEDBACKDESC].[FEEDBACKDESC].[FEEDBACKDESC].Members

    Note that if your dimension is non-aggregatable, then the second expression will not return any results as there will be no All member.

     


     

    Boyan Penev --- http://www.bp-msbi.com

    Give us some candy - please upvote helpful posts and mark your answers!

     


    • Marked as answer by Daniel Wu Friday, July 8, 2011 5:37 AM
    Friday, July 8, 2011 2:12 AM
  • All are same.

     

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].[Sales Reason] ON 1

    from

    [Adventure Works]

     

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].[All Sales Reasons].CHILDREN ON 1

    from

    [Adventure Works]

     

     

     

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].CHILDREN ON 1

    from

    [Adventure Works]

     


    vinu


    The last two will only be the same if the All member is the default. The last expression is equivalent to [Sales Reason].[Sales Reason].DefaultMember.CHILDREN

    And as Boyan has already pointed out, if you set the IsAggregateable property to false you will not have an all level so the second expression would return an empty set.

    The first syntax or the more explicit [Sales Reason].[Sales Reason].[Sales Reason].Members version is what I normally prefer to use.


    http://darren.gosbell.com - please mark correct answers
    • Marked as answer by Daniel Wu Friday, July 8, 2011 5:38 AM
    Friday, July 8, 2011 5:24 AM
    Moderator

All replies

  • All are same.

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].[Sales Reason] ON 1

    from

    [Adventure Works]

     

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].[All Sales Reasons].CHILDREN ON 1

    from

    [Adventure Works]

     

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].CHILDREN ON 1

    from

    [Adventure Works]


    vinu
    • Marked as answer by Daniel Wu Friday, July 8, 2011 5:38 AM
    Friday, July 8, 2011 2:06 AM
  • Hi Daniel,

    The two will return the same results in most cases. Mind you, the first one is equivalent to:

    [FEEDBACKDESC].[FEEDBACKDESC].[FEEDBACKDESC].Members

    Note that if your dimension is non-aggregatable, then the second expression will not return any results as there will be no All member.

     


     

    Boyan Penev --- http://www.bp-msbi.com

    Give us some candy - please upvote helpful posts and mark your answers!

     


    • Marked as answer by Daniel Wu Friday, July 8, 2011 5:37 AM
    Friday, July 8, 2011 2:12 AM
  • All are same.

     

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].[Sales Reason] ON 1

    from

    [Adventure Works]

     

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].[All Sales Reasons].CHILDREN ON 1

    from

    [Adventure Works]

     

     

     

    SELECT {} ON 0,

    [Sales Reason].[Sales Reason].CHILDREN ON 1

    from

    [Adventure Works]

     


    vinu


    The last two will only be the same if the All member is the default. The last expression is equivalent to [Sales Reason].[Sales Reason].DefaultMember.CHILDREN

    And as Boyan has already pointed out, if you set the IsAggregateable property to false you will not have an all level so the second expression would return an empty set.

    The first syntax or the more explicit [Sales Reason].[Sales Reason].[Sales Reason].Members version is what I normally prefer to use.


    http://darren.gosbell.com - please mark correct answers
    • Marked as answer by Daniel Wu Friday, July 8, 2011 5:38 AM
    Friday, July 8, 2011 5:24 AM
    Moderator