• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4888
  • Last Modified:

How to get sub totals and grand total in MDX query

Hi,

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
Rahul
0
theoremindia
Asked:
theoremindia
1 Solution
 
srnarCommented:
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

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now