![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
| MEMBER [Measures].[Wgtd Avg] AS |
#3
| |||
| |||
|
|
Assuming that [Wgtd Avg] is an average Yield, weighted by Cost, there are a couple of issues in the query below: - Avg() will perform a simple, not weighted average - When Cost = 0, the value considered is 0, not Yield Try weighted average by dividing Sums instead, like: MEMBER [Measures].[Wgtd Avg] AS 'SUM(CROSSJOIN({[PORTFOLIO SET]},{[DEPARTMENT SET]}), ([MEASURES].[Cost] * [MEASURES].[Yield])) / Iif(SUM(CROSSJOIN({[PORTFOLIO SET]},{[DEPARTMENT SET]}), [MEASURES].[Cost]) = 0, 1, SUM(CROSSJOIN({[PORTFOLIO SET]},{[DEPARTMENT SET]}), [MEASURES].[Cost]))' - Deepak *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |