Search code examples
mdxolap-cube

What are the ways to reference a dimension/attribute/measure in mdx?


I need to analyse user queries for Olap Cube to find out which dimensions, attributes and measures aren't used. My idea is to use a list of names of dimensions, attributes and measures and find out how many times were they used with regular expressions. However, I need to be sure that I haven't missed any formatting options and I don't really know MDX. My assumptions are:

Dimension: Dimension name is always enclosed by square brackets [] or by apostroves '' [['] dimensionName []']

Attribute: Attribute is always preceeded by it's dimension formatted as above and enclosed in square brackets [['] dimensionName []'].[attributeName]

Measure: Measure is always enclosed by square brackets, of surrounded with arithmetical operation signs, or combination of these two

Are those assumptions correct? If not, how can I improve them to cover all cases?


Solution

  • [Measures] is a dimension as well.

    • [Measures].[MeasureName] — the measure was used.

    • [DimensionName].[AttributeName] — the dimension and its
      attribute were used.