dbTalk Databases Forums  

Conditional Average logic

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


Discuss Conditional Average logic in the microsoft.public.sqlserver.olap forum.



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

Default Conditional Average logic - 06-10-2004 , 07:18 PM






Hi all,

I have a 2 level time dimension: Month, Week
The week level has an associated member property Interest
Rate. I'm hoping to take the average of the week's
respective interest rates and make that the month total.

Thanks in advance.

Mark

Reply With Quote
  #2  
Old   
Martin Mason
 
Posts: n/a

Default Re: Conditional Average logic - 06-10-2004 , 08:36 PM






Use a custom member formula for the Month members. First, create a
calculated member in the cube equal to the following:
CREATE MEMBER [Measures].[Interest Rate] AS
'CDbl([Time].CurrentMember.Properties("Interest Rate"))'

Then, for the month members, the Total Interest Rate will be the following:
AVG( { [Time].[Month].CurrentMember.Children }, ( [Measures].[Interest
Rate] ) )

I'm guessing, but it should be close enough to get you started.
HTH,
Martin

"Mark Frank" <mark.a.frank (AT) wellsfargo (DOT) com> wrote

Quote:
Hi all,

I have a 2 level time dimension: Month, Week
The week level has an associated member property Interest
Rate. I'm hoping to take the average of the week's
respective interest rates and make that the month total.

Thanks in advance.

Mark



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.