Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum Rss Feed

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
Free Newsletters:

News Via RSS Feed

Rss Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles


Posted Dec 16, 2002

MDX Essentials: Structure of the MDX Data Model - Page 2

By William Pearson

The Building Blocks: Tuples and Sets

Many of us have, by now, come across the argument surrounding the pronunciation of the word "tuple" that rages within the OLAP and associated arenas. Few disagree, however, as to the importance of the role that the tuple plays in MDX syntax in general, in set construction specifically, and in overall expression building. Axes, too, play an important role in locating values along the dimension members they represent. In addition, sets comprise the next level of construction, and share importance as a significant building block within MDX.

We will take a look at these three basic elements of multidimensional structures first, as we prepare for subsequent lessons covering more advanced components and concepts within the MDX language. We will perform straightforward practice exercises at appropriate junctures to reinforce our understanding of the concepts as we introduce them.



A tuple is a collection of members, each of which is selected from a different dimension. To illustrate, (Sales, 1997) conceptually represents a tuple that is composed of members that might exist in an OLAP cube from two dimensions: measures (recall that measures are yet another dimension from a syntactical perspective) and time. The tuple (Non-Consumable, Sales, 1997) is composed of members of three different dimensions: product, measures, and time. The tuple is the basic unit for forming an axis, which we will discuss below.

An important thing to remember when considering tuples is that, while they can be composed of one or more members from a number of dimensions, only one member from each dimension can exist in a given tuple. A tuple can be composed of any and all dimensions, including, as we have already noted, the measures dimension.


The syntax for a tuple follows a few basic rules, the chief of which are detailed in Table 1 below:


































Single Member / Single Dimension


List dimension alone






















Multiple Members / Multiple Dimensions


Surround tuple membership in parentheses


([Dim1].[Member], [Dim2].[Member], [Dim3].[Member])




























(1) Single members can be enclosed within parentheses, but are not required to be.









Table 1: Syntax Table: Tuples (General)

With square brackets "[ ]" serving as delimiting characters, MDX uses tuples to identify cell "addresses." Any cell value can be mapped using a tuple made up of one distinct member from each of a cube's dimensions. We can project dimensions to columns, rows, pages and other axes (see the Axes section below). An important concept to carry away from this section is that every intersection of multiple tuples results in yet another tuple. The ultimate outcome off combining all the tuples in a query is, after all, a cell with a value that is defined by the coordinates provided within the "grand tuple." In usage, a tuple refers to either a combination of members (the "grand tuple") -- and the cell that the combination defines (an "address", as it were) -- or to the value or values in the cell or cells that is specified by the tuple.

We will revisit this concept many times over the series, so as to examine it and understand it from multiple perspectives. Seeing concepts in action is often the best way to learn, and there will be ample opportunity to do so as we progress.

Page 3: Axes

MS SQL Archives

Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
SQL 2005: SSIS: Error using SQL Server credentials poverty 3 August 17th, 07:43 AM
Need help changing table contents nkawtg 1 August 17th, 03:02 AM
SQL Server Memory confifuration bhosalenarayan 2 August 14th, 05:33 AM
SQL Server Primary Key and a Unique Key katty.jonh 2 July 25th, 10:36 AM