dbTalk Databases Forums  

Calculated field question sum of a product rather then the product of sums

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


Discuss Calculated field question sum of a product rather then the product of sums in the microsoft.public.sqlserver.olap forum.



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

Default Calculated field question sum of a product rather then the product of sums - 07-26-2006 , 11:14 AM






Here is my calculated field. I want to sum the "effective
duration" * "portfolio weight" but what I get back is the sum of
the "effective duration" * sum of "portfolio weight".

How would I write that code or should I do that calculation when I am
importing the data into the fact table.

CREATE MEMBER CURRENTCUBE.[MEASURES].[Weighted Duration]
AS Case

When IsEmpty
(
[Measures].[Effective Duration]
)
Then Null
When IsEmpty
(
[Measures].[Portfolio Weight]
)
Then Null
Else (
[Measures].[Effective Duration] * [Measures].[Portfolio Weight]
)

End,
FORMAT_STRING = "#,#.0000",
VISIBLE = 1 ;


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.