dbTalk Databases Forums  

Mean MDX

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


Discuss Mean MDX in the microsoft.public.sqlserver.olap forum.



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

Default Mean MDX - 07-27-2006 , 12:46 AM






Hi all,

I have a single cube with a single measure (count), I also have several
dimensions.

I need to calculate the mean of the total count for a dimension by another
dimension.

I am unsure how to go about calculating a count of my dimension.

I am using SQL2005.

Thanks for your help.



Reply With Quote
  #2  
Old   
yongli
 
Posts: n/a

Default RE: Mean MDX - 07-27-2006 , 12:42 PM






Hi,

First define your dimension set, here I am using dim.members for simplicity.
then mean can be calcualted as:

sum(dim.members)/dim.members.count

"ashvsaod" wrote:

Quote:
Hi all,

I have a single cube with a single measure (count), I also have several
dimensions.

I need to calculate the mean of the total count for a dimension by another
dimension.

I am unsure how to go about calculating a count of my dimension.

I am using SQL2005.

Thanks for your help.




Reply With Quote
  #3  
Old   
ashvsaod
 
Posts: n/a

Default Re: Mean MDX - 07-27-2006 , 07:09 PM



Thanks.

I am having issues with this.

The count of the members of my dimension changes depending upon another
dimensions selection. This second dimension is used as in a where
statement.

Essentially Dimension 1 contains the items purchased
Dimension 2 is how many times the customer has been to our store

Thus the user will select from dimension2 a number as an example lets say 2.
This will filter the data to all customers that have been to our store
twice. How do I then allow the mean to calculate the number of members of
dimension 1 correctly?


"yongli" <yongli (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

First define your dimension set, here I am using dim.members for
simplicity.
then mean can be calcualted as:

sum(dim.members)/dim.members.count

"ashvsaod" wrote:

Hi all,

I have a single cube with a single measure (count), I also have several
dimensions.

I need to calculate the mean of the total count for a dimension by
another
dimension.

I am unsure how to go about calculating a count of my dimension.

I am using SQL2005.

Thanks for your help.






Reply With Quote
  #4  
Old   
yongli
 
Posts: n/a

Default Re: Mean MDX - 08-04-2006 , 02:44 PM



If you don't want the dimension1 count vary by other dimension, you could
force allmember for other dimension. For example

count(dimension1.members, dimension2.allmember)

"ashvsaod" wrote:

Quote:
Thanks.

I am having issues with this.

The count of the members of my dimension changes depending upon another
dimensions selection. This second dimension is used as in a where
statement.

Essentially Dimension 1 contains the items purchased
Dimension 2 is how many times the customer has been to our store

Thus the user will select from dimension2 a number as an example lets say 2.
This will filter the data to all customers that have been to our store
twice. How do I then allow the mean to calculate the number of members of
dimension 1 correctly?


"yongli" <yongli (AT) discussions (DOT) microsoft.com> wrote in message
newsEAAED4F-6545-4564-84E6-8BFD4D78FEB9 (AT) microsoft (DOT) com...
Hi,

First define your dimension set, here I am using dim.members for
simplicity.
then mean can be calcualted as:

sum(dim.members)/dim.members.count

"ashvsaod" wrote:

Hi all,

I have a single cube with a single measure (count), I also have several
dimensions.

I need to calculate the mean of the total count for a dimension by
another
dimension.

I am unsure how to go about calculating a count of my dimension.

I am using SQL2005.

Thanks for your help.







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.