Types of Expressions in MDX
An MDX statement contains expressions that operate on sets, tuples, members, numbers and strings. These expressions form the basis of OLE DB for OLAP’s ability to provide a rich and powerful syntax for specifying datasets.
Expressions in MDX operate on the following basic entities:
-
Number. A number can be an exact numeric such as integer or decimal, or an approximate numeric such as a float or double. You can compose numbers by the usual operators of addition, subtraction, multiplication, and division to yield other numbers. These compositions constitute numeric value expression elements.
-
String: A string is a sequence of characters.
-
Member. This represents a member of a dimension. A member value expression can operate upon a member element, which yields other member elements. For example, Boston.Parent yields the parent of the member Boston, which is Massachusetts.
-
Tuple. A tuple is a collection of members from different dimensions. For example, (Boston, [1995]) is a tuple formed by members of two dimensions: Geography and Time. A single member is a degenerated case of a tuple and can be used as an expression without the parentheses.
-
Set. A set is a collection of tuple elements. A set value expression operates on member, tuple, and set elements to yield other sets. A numeric function operates on a set element and yields a number. For example, the function SUM({USA, France}, Sales) operates on the set {USA, France} and yields the sum of Sales. A tuple value expression operates on a set element and yields tuple elements.