MDX_Tips
In SQL, We query rows and tables to produce a flat result set.
However, In MDX we are using tuples and sets to slice and aggregate a multidimensional cube.
A tuple is a single hierarchy member taken from all the dimensions.
Suppose Time.[2nd half] is a tuple of time dimension.
At the same way we can have multiple tuples and we represent them in '(',')' brackets.
set contains one or more tuples it may zero also. we represent them in { , } braces. Eg:
Imagine you have 3d Cube with dimensions X, Y and Z. The number of cells in the cube is number of
members in X multiplied by the number of members of
Y multiplied by the number of members of Z.
Each cell with have a coordinate in the cube based on a value from X, Y and Z. That coordinate is a Tuple.
So lets say :
X is Measures,
Y is Years,
Z is Products,
Then a single cell could be the laptop sales for 1999. The cell coordinate will be: logically (X, Y, Z) and physically this is a tuple such as
(Measures.Sales, Years.[1999], Products.[Laptop])
Now lets say we want multiple cells, then we need multiple tuples, right? Yes, a Set is basically multiple tuples. Actually by multiple I include 0 and 1. So extending our example, we could have laptops from 1999 and desktops from 2001:
{
(Measures.Sales, Years.[1999], Products.[Laptop]) ,
(Measures.Sales, Years.[2001], Products.[Desktop])
}
So you can see that you end up with multiple items with a set, and a single item with a tuple...