Skip to main content

Accessing Properties

Accessing Properties

In MDX, a level can have properties that are specific to the level. Each member of the level can have a different value for the property. You can access these properties and display them in your query results. There are two kinds of properties:

  • User-defined properties. In Business Intelligence, these are defined within the cube definition. For example, in the DemoMDX cube, the City level has two properties called Population (population of the city) and Principal Export (the principal export of the city).

  • Intrinsic properties, which contain information such as the member name and the member’s key. For a list, see the reference section Intrinsic Properties in the InterSystems MDX Reference.

Names of properties are not case-sensitive.

To access the property of a member, use the PROPERTIES function. For example:

SELECT homed.city.magnolia.PROPERTIES("Principal Export") ON 0 FROM demomdx
                                           
                                 bundt cake

For another example:

SELECT homed.cypress.LEAD(1).PROPERTIES("name") ON 0 FROM demomdx

                                      name
                                   Magnolia

Properties As String Expressions

MDX treats property values as strings. MDX also supports string literals (for example, "my label") and a concatenation operator (+). Therefore, you can create expressions like the following:

"Next after Cypress: " + homed.cypress.LEAD(1).PROPERTIES("name")

And you can use such expressions in MDX queries. For example:

SELECT "Next after Cypress: " + homed.cypress.LEAD(1).PROPERTIES("name") ON 0 FROM demomdx
 
                                Expression
                         Next after Cypress: Magnolia

Properties and Attributes

Properties are not the same as attributes, which are often mentioned when MDX is discussed.

In some implementations of MDX, attributes are used to define a cube. No MDX functions, however, directly use attributes.

The system does not use attributes.

FeedbackOpens in a new tab