Database Reference
In-Depth Information
Since there is an order in a hierarchy, you can specify that you wish to get a set of
members using the syntax {[member] : [member]} . This will get the members
between the members defined in the set statement. An example of this can be seen
when executing the following query:
--Query 5.14
SELECT [Measures].[Sales Amount] ON 0,
{[Product].[Product Hierarchy].[Product
Category].&[1]:
[Product].[Product Hierarchy].[Product
Category].&[4]}
ON 1
FROM [Adventure Works DW2012];
In this case members between 1 and 4 are shown in the result; this means that the
list includes member 3 as well.
Calculated members
Another thing that you can do in MDX is to specify calculations as members to be
used in your queries. The following query shows this:
--Query 5.15
WITH MEMBER [Product].[Product
Hierarchy].[Bikes and Clothing] AS
([Product].[Product Hierarchy].[Product
Category].&[1] +
[Product].[Product Hierarchy].[Product
Category].&[3])
SELECT [Measures].[Sales Amount] ON 0,
[Product].[Product Hierarchy].[Bikes and
Clothing] ON 1
FROM [Adventure Works DW2012];
In the previous query, you specify the members, ( Bikes and Clothing ) that is, the
summary of the Bikes and Clothing members. Of course, a calculated member
can be referenced in a set as shown in this query:
Search WWH ::




Custom Search