Databases Reference
In-Depth Information
NOTE
The CurrentMember function returns a member. So, in the case where your WHERE
clause contains more than one member from the attribute that the hierarchy corre-
sponds to, the CurrentMember function returns an error.
Set Algebra and Basic Set Operations
In the earlier discussion about the multidimensional coordinate system and ways of defin-
ing the coordinates of multidimensional space, we stated—although not in these exact
words—that you can define a multidimensional space by projecting a set on an axis. In
this section, we discuss set algebra in greater detail and how it is used in MDX.
Three set algebra operations and two basic set operations enable you to construct new
MDX sets from existing ones:
.
Union
.
Intersect
.
Except
.
CrossJoin
.
Extrac t
Union
Union combines two or more sets of the same dimensionality into one set, as shown in
Figure 10.7. The resulting set contains all the tuples from each of the sets. If a tuple exists
in both of the original sets, it is added to the new ( Union ) set just once—the duplicate
tuple is not added. This operation is equivalent to the addition operator.
{[Renton], [Redmond]}
{[Edmonds]}
FIGURE 10.7
These two sets have been united using the Union operation.
The code that produces this result is as follows:
SELECT Union({[Renton],[Redmond]},{[Edmonds]}) ON COLUMNS
FROM [Warehouse and Sales]
Which returns the following set:
{Renton, Redmond, Edmonds}
Search WWH ::




Custom Search