![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
| ([Measures].[YTD Charge Amt] |
#3
| |||
| |||
|
|
Hi Fernando, You can try: [Measures].[Year End Forcast] = ([Measures].[YTD Charge Amt] * Count(Descendants(Ancestor( [PERIOD].CurrentMember, [PERIOD].[Year]), [PERIOD].CurrentMember.Level))) / Count(PeriodsToDate( [PERIOD].[Year], [PERIOD].CurrentMember)) - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#4
| |||
| |||
|
| Sum(Ancestor([PERIOD].CurrentMember,[PERIOD].[Year]), |
#5
| |||
| |||
|
|
Fernando, The behavior you're describing is different than my original interpretation. Here's an expression to extrapolate Charges for the current year, regardless of which member of the year is selected. You can further refine it to meet your needs: [Measures].[Year End Forcast] = Sum(Ancestor([PERIOD].CurrentMember,[PERIOD].[Year]), ([Measures].[Charge Amt] * Count(Descendants(PERIOD].CurrentMember,,LEAVES))) / Count(NonEmptyCrossJoin(Descendants( PERIOD].CurrentMember,,LEAVES)))) - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#6
| |||
| |||
|
| With Member [Measures].[Year End Forecast] as |
#7
| |||
| |||
|
|
Fernando, Here's a sample Foodmart query which may help: With Member [Measures].[Year End Forecast] as 'Sum({Ancestor([Time].CurrentMember,Time.[Year])}, ([Measures].[Unit Sales] * Count(Descendants([Time].CurrentMember,,LEAVES))) / Count(NonEmptyCrossJoin(Descendants( [Time].CurrentMember,,LEAVES))))' select {[Measures].[Unit Sales], [Measures].[Year End Forecast]} on 0, Descendants([Time].[1997]) on 1 from Sales - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Fernando, I'd suggest trying the query I posted - [YTD CHARGE AMT] may not be that relevant, based on your description. For example, if data is loaded for Jan and Feb, but the current time member selected is Jan, I assume that you still want to extrapolate the forecast charge based on both Jan and Feb data. But [YTD CHARGE AMT] will only reflect Jan data. - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |