Calculating subtotals using MDX
Posted: Fri Mar 26, 2010 12:13 pm
Hi,
I have the following query:
It returns data grouped by gender, then by marital status. How can I calculate me Unit Sales total but for Gender?
I tried with something like this
but it doesn't work, although I'm using [Gender].CurrentMember I still get the same numbers broken by marital status. Here's the result (through JPivot)

What I want to have is something like this (values circled in red are ones I want to calculate):

Thanks in advance,
Bane
Edit/Delete Message
I have the following query:
Code: Select all
SELECT
{ { [Measures].[Unit Sales]} } ON COLUMNS,
{ CrossJoin([Gender].[Gender].Members, [Marital Status].[Marital Status].Members) } ON ROWS
FROM Sales
I tried with something like this
Code: Select all
WITH MEMBER [Measures].[Unit Sales Subtotal Gender] AS
SUM({[Gender].CurrentMember}, [Measures].[Unit Sales])
SELECT
{ { [Measures].[Unit Sales], [Measures].[Unit Sales Subtotal Gender]} } ON COLUMNS,
{ CrossJoin([Gender].[Gender].Members, [Marital Status].[Marital Status].Members) } ON ROWS
FROM Sales

What I want to have is something like this (values circled in red are ones I want to calculate):

Thanks in advance,
Bane
Edit/Delete Message