Skip to main content

PROPERTIES (MDX)

Returns the value of the given property, for the given member.

Returned Type

This function returns a string.

Syntax and Details

member_expression.PROPERTIES(property_name,default_value))

Where:

  • member_expression is an expression that returns a member.

    This expression cannot refer to a measure.

  • property_name is a string that equals the name of the property.

    All members have certain intrinsic properties, listed in Intrinsic Properties. A cube definition can include definitions of additional properties.

  • default_value is an optional value to return if the member does not have a value for this property. If you omit this argument and if the given member does not have the property, the function returns @NOPROPERTY.

    This argument is an InterSystems extension to MDX.

Names of properties are not case-sensitive.

Example

The following example gets the value of the KEY property, which is an intrinsic property:

SELECT docd.h1.CURRENTMEMBER.PROPERTIES("KEY") ON 0, docd.[doctor].MEMBERS ON 1 FROM patients
 
                                     Doctor 
  1 None                             <null>
  2 Adam, Dan                            41
  3 Adam, Danielle                      391
  ... 

The following variation uses %LABEL to provide a better caption:

SELECT %LABEL(docd.h1.CURRENTMEMBER.PROPERTIES("key"),"key") ON 0, 
docd.doctor.MEMBERS ON 1 FROM patients
                                      key 
  1 None                             <null>
  2 Adam, Dan                            41
  3 Adam, Danielle                      391
  ... 

The following example uses CURRENTMEMBER and iterates through the ZIP codes to retrieve the values of two intrinsic properties: ID and LEVEL_NUMBER:

WITH SET test AS '{homed.h1.CURRENTMEMBER.PROPERTIES("id"),
homed.h1.CURRENTMEMBER.PROPERTIES("level_number")}' 
SELECT test ON 0, homed.zip.MEMBERS ON 1 FROM patients

                            Home ZIP             Home ZIP
1 32006                             2                    1
2 32007                             4                    1
3 34577                             1                    1
4 36711                             5                    1
5 38928                             3                    1

As a variation, the following query uses %LABEL to provide better captions:

WITH SET test AS '{%LABEL(homed.h1.CURRENTMEMBER.PROPERTIES("id"),"id"),
%LABEL(homed.h1.CURRENTMEMBER.PROPERTIES("level_number"),"level_number")}' 
SELECT test ON 0, homed.zip.MEMBERS ON 1 FROM patients

                                  id         level_number
1 32006                             2                    1
2 32007                             4                    1
3 34577                             1                    1
4 36711                             5                    1
5 38928                             3                    1

For more examples, see CURRENTMEMBER.

FeedbackOpens in a new tab