MDX in Analysis Services: Intermediate Concepts - Part 1 - Page 2
April 17, 2003
Cell Coordinates in MDX
MDX references specific cells in a way that embraces multidimensional concepts. The MDX notation system is fairly straightforward - with practice, one can easily read it in standalone form. Using a graphical illustration of a simple cube with three dimensions, we can express the coordinates (that is, the "address") for a cell in terms of the associated dimension intersect points. In Table 1, we represent a simple three-dimensional cube structure that displays the amount ("Actual" Amount) of expense incurred for the Los Angeles Store locations (in this case, a single store) of a grocery store chain, by expense account (Expense), over various time intervals (Time).
Table 2: Illustration of a Cell "Address" in a 3-Dimensional Cube
To specify the location of the highlighted cell in the cube depicted above, we would provide an "address" that consists of one member for each dimension in the cube. The highlighted cell in Table 1 would be assigned the "address" (or coordinates in terms of the dimensions of the cube) shown below:
([Los Angeles], [Marketing], [Time].[All])
The "address" referring to a cell, such as the one above, or to groups of cells, is typically referred to as a tuple. Although a tuple must specify a member (used as a coordinate) for every dimension in the cube, we do not have to specify dimensions in cases where we mean to refer to the current member. The current member is assumed as a default in the majority of cases, unless we need to specify the dimension explicitly.
NOTE: As is the case in our Los Angeles example above, parentheses surround tuples that contain more than a single dimension in MDX notation.
We often work with MDX expressions that are made up of multiple independent values. We can use tuples from our cube, constants, or other values within our expressions, as we will see, to provide these values - values that we can then "fuse" to meet our requirements through the use of operators, such as "+", "-", "*" or "/" . We will gain experience manipulating values and operators in the next section, where we will illustrate these concepts by putting them into action.