Member keys

Member keys facilitate easier access to the members in the MDX-based interfaces.

Member keys are stored as an attribute on the dimension. The MemberKey dimension property defines which attribute field serves as the member key. The attribute type must be string (preferred) or numeric.

You can retrieve member keys through schema requests or MDX requests. Using schema requests, member keys can be retrieved through the MEMBER_KEY column in the MDSCHEMA_MEMBERS schema. Using MDX requests, member keys can be retrieved using the Key member property in an MDX expression.

If the MemberKey dimension property is not specified or AttribTableID or FieldName does not exist, the member name is used instead.

An error is returned in case when a member key cannot be found. For example, &[49].

Syntax

[dimension name].&[member key]

Example 1: Retrieving a member key

In this example the member keys are stored in the Key attribute field in the first attribute table.

<Alea:Properties xmlns:Alea="http://www.misag.com">
   <Alea:MemberKey AttribTableID=”1” FieldName=”Key”/>
</Alea:Properties>

The attribute can be defined and filled by any tool.

Example 2: Using a member key

For example, if the element Germany has the member key 49, these statements have the same result:

SELECT {[Regions].[Germany]} ON COLUMNS FROM SALES
SELECT {[Regions].&[49]} ON COLUMNS FROM SALES