dbTalk Databases Forums  

Group total in MDX

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Group total in MDX in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Milind
 
Posts: n/a

Default Group total in MDX - 01-05-2005 , 11:50 AM






Hi All

I am stuck in a MDX query

I have two dimensions UserName and CallType

So the output should look like this

UserName CallType Calls TotalCallsbyCallType
Tom Cruise Appt. reminder 25 40
Tom Cruise Counseling 30 60
Jennifer An Intake 5 5
Jennifer An Appt. reminder 10 40
Jennifer An Outbound 20 20
Sheryl Crow Appt. reminder 5 40
Sheryl Crow Counseling 30 60

I have repeated the username for individual groups above for
understanding.. they dont appear multiple times in the report

I tried a lot of queries but doesnt help. Please help
thanks in advance

Milind


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Group total in MDX - 01-05-2005 , 09:18 PM






Assuming that [Calls] is a base measure of [CallCube],
and that [UserName] and [CallType] are leaf levels:

Quote:
With Member [Measures].[TotalCallsbyCallType] as
'([Measures].[Calls], [UserName].[All UserName])'

Select {[Measures].[Calls],
[Measures].[TotalCallsbyCallType]} on columns,
NonEmptyCrossJoin([UserName].[UserName].Members,
[CallType].[CallType].Members on rows
from [CallCube]
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.