SSAS - Moving Annual Total
Environment: SQL-Server-2005, SSAS 2005
I am using the following formula to create a Moving Annual Total
SUM ({[Time].CurrentMember.Lag(3):[Time].CurrentMember}, [Measures].[TRx Quantity]开发者_JAVA百科)
The same column [Measures].[Trx Quantity]
is used in other calculations and it works fine. This one, however, comes up with #Value!
to indicate some kind of an error. Can anyone point me in the proper direction here?
Is this SSAS 2005/2008?
If it is either of these and you are running this in Management Studio you can hover over the #Value and get the details of the error.
But at a guess it is most likely because .CurrentMember needs to be called on a hierarchy and [Time]
is a dimension reference. It should refer to one of the hierarchies like [Time].[Calendar].CurrentMember
or maybe [Time].[Quarter].CurrentMember
It turned out to be that I was missing the MONTH
SUM ({[Time].[Month].CurrentMember.Lag(3):[Time].[Month].CurrentMember}, [Measures].[TRx Quantity])
精彩评论