MDX Property Expressions

In addition to querying for intrinsic and custom properties of a member, you can also query for MDX properties using the PROPERTY_EXPR function. This function enables you to query for properties of related members based on a member value expression.

Syntax

PROPERTY_EXPR (dimension name, property_name, member_value_expression, display_name)
ParameterDescription

dimension name

The dimension name, or the keyword ALL. When a dimension name is specified, the property expression is evaluated for members from that dimension only. When the keyword ALL is specified, the property expression is evaluated for all members on the axis.

property_name

Property specification. One of the intrinsic properties (MEMBER_NAME, MEMBER_ALIAS, LEVEL_NUMBER, GEN_NUMBER, IS_EXPENSE, COMMENTS, RELATIONAL_DESCENDANTS, or MEMBER_UNIQUE_NAME), or one of the custom properties (an attribute dimension name, alias-table name, or UDA specification).

member_value_expression

Member value expression. See <member_value_expression> ::= in MDX Grammar Rules.

display_name

Character string literal. The display name to use for the queried properties information in the query output.

Description

For every member on an axis from dimension name, the member_value_expression is evaluated with the current member from dimension name in the context. The property_name is evaluated on the output of member_value_expression. The specified display_name indicates the label to use for the queried properties output.

You can refer to the current member on the axis by using CurrentAxisMember.

Example

SELECT
 {[100]}
ON COLUMNS, 
Market.Levels(0).Members 
 DIMENSION PROPERTIES 
  PROPERTY_EXPR
   (
    Market,
    MEMBER_NAME,
    Ancestor
     (
      Currentaxismember(), 
      Currentaxismember().Dimension.Levels(1)
     ),
   "Parent_level_1"
   ),
  PROPERTY_EXPR
   (
    Market,
    MEMBER_NAME,
    Ancestor
     (
      Currentaxismember(), 
      Currentaxismember().Dimension.Levels(2)
     ),
   "Parent_level_2"
   ),
ON ROWS 
FROM Sample.Basic;

which returns the following grid (truncated):

(axis)Axis-1.properties100
[New York]Parent_level_1 = East, Parent_level_2 = market3498
[Massachusetts]Parent_level_1 = East, Parent_level_2 = market5105
[Florida]Parent_level_1 = East, Parent_level_2 = market2056
.........