Database Reference
In-Depth Information
--Query 5.16
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],
[Product].[Product Hierarchy].[Product
Category].&[4],
[Product].[Product Hierarchy].[Product
Category].&[1],
[Product].[Product Hierarchy].[Product
Category].&[3]}
ON 1
FROM [Adventure Works DW2012];
A calculated member can also be put on the measures dimension and be used to
calculate different values in the query. The following query shows an example of this:
--Query 5.17
WITH MEMBER [Measures].[Avg Sales] AS
[Measures].[Sales Amount]/[Measures].[Fact
Internet Sales Count]
SELECT {[Measures].[Avg Sales],
[Measures].[Sales Amount],[Measures].[Fact
Internet Sales Count]} ON 0,
[Product].[Product Hierarchy] ON 1
FROM [Adventure Works DW2012];
Named sets
In MDX, you cannot only create calculated members using the WITH clause, you can
also create a named set. The following query is an example of this:
Search WWH ::




Custom Search