Database Reference
In-Depth Information
As you can see, while the Sales Amount measure always shows the sales for the
country displayed on rows, the new calculated measure always shows sales for the
USA. This is always the case no matter what other hierarchies are used in the query
or where the measure itself is used:
The calculated measure always shows the value of sales for the USA, even when
we have broken sales down by Year. If we wanted to fix the value of the calculated
measure by one more hierarchy, perhaps to show sales for male customers in the
USA, we would just add another member to the list in the tuple as follows:
([Measures].[Sales Amount], [Customer].[Country].&[United States],
[Customer].[Gender].&[Male])
Aggregating members
A tuple cannot, however, contain two members from the same hierarchy. If we need
to do something like show the sum of sales in the UK and USA, we need to use the
AGGREGATE functions on a set containing those two members:
CREATE MEMBER
CURRENTCUBE.[Customer].[Customer Geography].[All].[UK and USA] AS
AGGREGATE(
{[Customer].[Customer Geography].[Country].&[United Kingdom],
[Customer].[Customer Geography].[Country].&[United States]});
The preceding statement creates a new member on the Customer Geography
hierarchy of the Customer dimension called UK and USA , and uses the AGGREGATE
function to return their combined value.
 
Search WWH ::




Custom Search