MDX syntax elements

This section provides lists of all the functions, operators and methods that can be used in MDX statements.

The default format string used by the MDX engine is Standard (#,##0.00). You can find further information on format strings here:

https://docs.microsoft.com/en-us/sql/analysis-services/multidimensional-models/mdx/mdx-cell-properties-format-string-contents

These items are not supported:

  • Formatting date values
  • Semicolon (;) and forward slash (/) characters in numeric formats

In order that the MDX parser can parse a string in the MDX statement as an entity (member, dimension, level, named set, property), strings containing these characters must be surrounded by square brackets:

  • Special characters: space, quote, double quote, comma, dot, {, }, (, ), etc.
  • Non ASCII characters: ä, ö, €, etc.
  • Comment characters: //, /*, */
  • Operators: +, *, -, /
  • Reserved MDX keywords: SELECT, FROM, etc.
  • Reserved MDX functions name: DefaultMember, CurrentMember, etc.
  • Numeric: 2012, 0001, etc.

Square brackets cannot be part of any name for:

  • Dimensions
  • Cubes
  • Elements
  • Attributes
  • Levels

Example

SELECT { [defaultmember], [2012], [from], [proview vga 12] } ON COLUMNS, {} ON ROWS FROM TotSales