DeepSee MDX Reference
PROPERTIES
[Back] [Next]
   
Server:docs2
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

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:
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.