次の方法で共有


YTD Based on Current System Date (Now() Function), based on same date pulling value for Last Year too.

 

In this example we are trying to pull ytd based on current date using Now Function.

 

with member [Date].[Calendar].[currentyear] as aggregate(ytd((strtomember("[Date].[Calendar].[Date].&["+format(now(),"yyyyMMdd")+"]"))))

member [Date].[Calendar].[prevyear] as aggregate(ytd(parallelperiod([Date].[Calendar].[Calendar Year] ,1,(strtomember("[Date].[Calendar].[Date].&["+format(now(),"yyyyMMdd")+"]")))))

Get Complete Example on

https://blogs.msdn.com/b/karang/archive/2010/10/25/ytd-based-on-current-system-date-now-function-based-on-same-date-pulling-value-for-last-year-too.aspx