Trouble Generating 'Totals' & 'Grand Total' with MDX stmt.

This is a discussion on Trouble Generating 'Totals' & 'Grand Total' with MDX stmt. within the sqlserver-olap forums in Data Warehousing category; Hi, The following query gives 'Items Sold' by Region & by State nicely. I want to include 'Totals' & 'Grand Total'. Can the experts help with the MDX query please? SELECT [Measures].[Items Sold] ON COLUMNS, CROSSJOIN([Geog].[REGION_CD].Children, [Geog].[STATE_ROLLUP_CD].children) ON ROWS FROM [SALES CUBE] Items Sold Mid-Atlantic Delaware 100 Mid-Atlantic Columbia 200 Mid-Atlantic Maryland 300 TOTAL 600 North Central Colorado 250 North Central Illinois 350 North Central Indiana 300 TOTAL 900 GRAND TOTAL 1,500 I tried the following MDX stmt and got sort of 'Totals' & 'Grand Totals' (Labels are bad, could ...

Go Back   Database Forum > Data Warehousing > sqlserver-olap

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-18-2008, 03:06 AM
Default Trouble Generating 'Totals' & 'Grand Total' with MDX stmt.


Hi,

The following query gives 'Items Sold' by Region & by State nicely. I want
to include 'Totals' & 'Grand Total'. Can the experts help with the MDX query
please?

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

Items Sold
Mid-Atlantic Delaware 100
Mid-Atlantic Columbia 200
Mid-Atlantic Maryland 300
TOTAL 600
North Central Colorado 250
North Central Illinois 350
North Central Indiana 300
TOTAL 900
GRAND TOTAL 1,500

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.

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

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

Thanks,

Venkat.




Reply With Quote
  #2  
Old 08-22-2008, 05:51 AM
Default Re: Trouble Generating 'Totals' & 'Grand Total' with MDX stmt.

hi

I am new to data warehousing . Pls guide me how to make cubes or
reporting services .

mi gmailId is er.rahuls85
Reply With Quote
  #3  
Old 08-22-2008, 12:08 PM
Default Re: Trouble Generating 'Totals' & 'Grand Total' with MDX stmt.

I am not sure why you replied to my post. If you need help, you should post
it as a question/ new request.

Thanks

Venkat.

"raul" wrote:

> hi
>
> I am new to data warehousing . Pls guide me how to make cubes or
> reporting services .
>
> mi gmailId is er.rahuls85
>

Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 04:44 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.