Skip to main content

Set the default member of a dimension

Overview

When a default member is not specifically set, Analysis Services will elect the first member in a hierarchy as the default member. For all dimensions this will be the All Member unless the All Member has been hidden (see Hiding the AllMember in an OLAP Dimension ).

This document will describe how to set the default member to a specific member in a hierarchy.

Process

  1. Add a custom script

  2. Add the following XPATH XMLA script in the custom step dialog

    XMLA Script

          <Script>
    						      <AddNameSpace Alias="my" AddNameSpace="http://schemas.microsoft.com/analysisservices/2003/engine"/>
    						      <InsertEnd Node="//my:Attribute[my:ID='']" SearchType="Path" Operator="All">
    						      <DefaultMember>[].[].&amp;[]</DefaultMember>
    						      </InsertEnd>
    						      </Script>
    					
  3. Drag the attribute for which the default member should be set and drop it between the two single quotation marks. Drag the Dimension name to the first pair of [], Drag the attribute for which the default member should be set to the second pair of [] Write the value of which the default member should be set to between the third pair of []. Remember this is the key value and not the description. By doing so one ensures not to break the code should the attribute later be renamed.

  4. Add the script to the dimension as an inline script.

    Select the script from the drop down.

  5. Deploy and Execute After deployment and execution the default member will be set to the selected value.

Was this article helpful?

We're sorry to hear that.