dbTalk Databases Forums  

sum a measure on several dimensions

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


Discuss sum a measure on several dimensions in the microsoft.public.sqlserver.olap forum.



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

Default sum a measure on several dimensions - 01-20-2006 , 07:52 AM






Hi to all,
I need to build a calculated member showing the sum of a certain
measure value on more than a dimension.
If, for example, i had N dimensions dim1,dim2...dimN and a measure
called M, I would like the sum of M over all the N dimensions.

I tried the following MDX formulas on one dimension each time and they
work:
Sum({([All dim1])},[Measures].[M])
...
Sum({([All dim2])},[Measures].[M])

but when I try the sum on more than one dimension, with the MDX
Sum({([All dim1]),([All dim2]),...,([All dimN])},[Measures].[M])
it doesn't work!

Why???
Any suggestion will be valued!
Thanks,
Gabriele


Reply With Quote
  #2  
Old   
 
Posts: n/a

Default Re: sum a measure on several dimensions - 01-20-2006 , 07:56 PM






Would I be correct in assuming that you want the sum at the intersection
of a number of members? If this is the case then you want to create a
set with a single tuple (what you have in your example is a set of many
tuples.

eg.

Sum({([dim1].[dim1 member,[dim2].[dim2 member],...,[dimN].[dimN
member)},[Measures].[M])

If you have a set of member in each dimension then you will need to
crossjoin these sets to return a single set which you can then sum.

eg.

Sum(NonEmptyCrossjoin({[dim1].[dim1 member1],[dim1].[dim1 member2},
{[dim2].[dim2 member1],[dim2].[dim2 member2},[Measures].[M]),[Measures].
[M])


--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1137765165.077763.72430 (AT) o13g2000cwo (DOT) googlegroups.com>,
gabriele.ebasta (AT) gmail (DOT) com says...
Quote:
Hi to all,
I need to build a calculated member showing the sum of a certain
measure value on more than a dimension.
If, for example, i had N dimensions dim1,dim2...dimN and a measure
called M, I would like the sum of M over all the N dimensions.

I tried the following MDX formulas on one dimension each time and they
work:
Sum({([All dim1])},[Measures].[M])
..
Sum({([All dim2])},[Measures].[M])

but when I try the sum on more than one dimension, with the MDX
Sum({([All dim1]),([All dim2]),...,([All dimN])},[Measures].[M])
it doesn't work!

Why???
Any suggestion will be valued!
Thanks,
Gabriele



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.