sql server 2008 - Display Previous YTD Value member on MDX for SSAS? -


ytd working fine need value previous year. following previous ytd displays total previous years amount. example of august 2013, ytd display total ytd amount january august in 2013 , previous ytd should display total ytd amount january august 2012.

ytd

create member currentcube.[measures].[ytd amount]  aggregate(ytd(), [measures].[amount]),  format_string = "$#,##0.00;-$#,##0.00",  non_empty_behavior = { [amount] },  visible = 1 ,  associated_measure_group = 'tf - bu transaction';  

previous ytd

create member currentcube.[measures].[prev ytd amount]  (parallelperiod(    [mf - time].[year - month].[year]    ,1    ,[mf - time].[year - month].currentmember)   , [measures].[ytd amount]),  format_string = "$#,##0.00;-$#,##0.00",  non_empty_behavior = { [amount] },  visible = 1 ,  associated_measure_group = 'tf - bu transaction';  

i'm not sure can use year date calculation in pytd calculation because need ytd outside of parallell period.

try:

member [measures].[prev ytd amount]     sum(             ytd(                 parallelperiod(                     [mf - time].[year - month].[year],                      1,                      [mf - time].[year - month].currentmember                 )             ),             [measures].[amount]         ) 

source: www.bidn.com/blogs/cprice1979/ssas/2473/fun-with-mdx-ndash-part-3-ytd-and-prior-ytd-calculations


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -