Skip to main content

Accessing Single Members of a Level

Accessing Single Members of a Level

You can select a single member by referring to it directly. The general syntax is as follows:

[dimension_name].[hierarchy_name].[level_name].[member name]

As noted previously, in InterSystems MDX, you can omit the hierarchy name. Similarly, you can omit the level name.

For example:

SELECT MEASURES.[%COUNT] ON 0, allerd.[ant bites] ON 1 FROM demomdx 

                                    %COUNT
ant bites                                47

Member Names

In a given level, member names are not required to be unique; that is, when the cube is built, no checking is performed to ensure that member names are unique in a given level. For example, the Doctor dimension can include multiple members with the same name.

Member Keys

In a well-defined cube, each member has a unique, case-sensitive key. To refer to a member by its key, use the following syntax:

[dimension_name].[hierarchy_name].[level_name].&[member_key]

In many cases, member_key is the same as the member name. For a generated Null member, the key is <null>.

For details on how the system generates member keys, see the reference section Key Values in the InterSystems MDX Reference.

MDX provides a function (PROPERTIES), which you can use to access the key (or any other property) of a member; this function is discussed later in this page.

FeedbackOpens in a new tab