Answered default member

  • Friday, April 13, 2012 7:42 PM
     
     

    hi please let me know what is the default member for measure group and dimensions as well

    many thanks in advance


    Regards, Shanu

All Replies

  • Friday, April 13, 2012 9:16 PM
     
     Answered Has Code

    Shanu,

    That's a good question... If you do nothing, then [All] members in dimension attributes will generally be the default member. 

    Here's some MDX you can use to look at what you're default members are, and another is MDX to change it. Note that you can change default members in BIDS/SSDT as well...it just depends on your preference where you want to maintain this information (BIDS is probably more intuitive, MDX script more flexible)

    /*************  How to inspect what the default member is right now ***************/

    with
    member Measures.[Default Measure] AS [measures].DefaultMember.Member_Name
    member Measures.[Default Date] AS [Date].[Date Key].DefaultMember.Member_Name
    select
     {Measures.[Default Measure], Measures.[Default Date]} ON 0
     FROM
     [CubeName]

    /************  How to set the default member to what you prefer (in the cube MDX script) ***********/

    ALTER CUBE CURRENTCUBE UPDATE DIMENSION Measures, DEFAULT_MEMBER=[Measures].[Profit]
    

    Rob Kerr SQL Server MVP CTO, BlueGranite

    • Proposed As Answer by Raunak J Monday, April 16, 2012 7:23 AM
    • Marked As Answer by Challen FuModerator Sunday, April 22, 2012 9:56 AM
    •  
  • Monday, April 16, 2012 9:29 AM
     
     
    In Addition to the above, I think the Default Measure is generally the first measure that is added to the cube - so the first measure in the first measure group you create. As mentioned, you can change this in both the script of BIDS/SSDT