Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
SQL
ce
clients
clustering
connect
datamining
datawarehouse
dts
fulltext
jdbcdriver
msde
mseq
newusers
notificationsvcs
odbc
olap
programming
replication
reportingsvcs
security
securitytools
server
setup
sqlxml.viewmapper
tools
xml
  
 
date: Wed, 20 Aug 2008 19:37:01 -0700,    group: microsoft.public.sqlserver.olap        back       


MDX help for Totals & GT   
Hi,

The following query gives 'Items Sold' by Region,  State. (side by side)

SELECT
    [Measures].[Items Sold] ON COLUMNS,
    CROSSJOIN([Geog].[REGION_CD].Children, [Geog].[STATE].children) ON ROWS
FROM [SALES CUBE]	

But I want to include 'Totals' & 'Grand Total'. 

I tried the following MDX stmt and got sort of 'Totals' & 'Grand Totals' 
(Labels are bad, could not customize). But the query generated too many 
'Grand Total' rows at the end instead of 1 final GT because of CROSS JOIN.

How to just get 1 Grand Total at the end & customize the Total & GT labels?

SELECT
    [Measures].[Items Sold] ON COLUMNS,
    CROSSJOIN(
   {[Geog].[REGION_CD].Children, [Geog].[REGION_CD]}, 
   {[Geog].[STATE].children, [Geog].[STATE]}) ON ROWS
FROM [SALES CUBE]	

Can the experts help with the MDX query please?

Report format i Need:
====================================
		                Items Sold                                
Mid-Atlantic	Delaware	100
Mid-Atlantic	Columbia	200
	TOTAL	300
North Central	Colorado	250
North Central	Illinois	350
	TOTAL	600
GRAND TOTAL		900

Thanks,

Venkat.
date: Wed, 20 Aug 2008 19:37:01 -0700   author:   Prasad

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us