How to get sub totals and grand total in MDX query


Is it possible to get subtotals and grand total in MDX query? Is there any alternative for "WITH ROLLUP" in MDX?

Sample query will be greatly appreciated.

Thanks in advance
Who is Participating?
srnarConnect With a Mentor Commented:
This code comes from ProClarity. You can see a local calculated member [ Subtotal].

WITH MEMBER [Product].[Product Model Categories].[All Products].[ Subtotal] AS ' AGGREGATE( EXISTING { [Product].[Product Model Categories].[All Products].CHILDREN }) ', SOLVE_ORDER = 1000  SELECT { [Date].[Calendar].DEFAULTMEMBER } ON COLUMNS ,
{ { [Product].[Product Model Categories].[All Products].CHILDREN }, { [Product].[Product Model Categories].[All Products].[ Subtotal] } } ON ROWS  
FROM [Adventure Works] 
WHERE ( [Measures].[Reseller Sales Amount] )

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.