Monday 21 December 2015

Dimensional Current Month Part 2

In a previous post, it was shown how to obtain the current month in dimensional package. That was on the assumption that the Member Unique Name (MUN) can be generated using a logical function. In the unfortunate event that, that is not possible, here are a couple of techniques to get the current month.

I. Modify your data in  such a way that the last value of your Month level is the current month. For example today is May 2014, that month should be the last value of your month level. Then you can use the function closingPeriod:
[Current Month] = closingPeriod([Package].[Time].[Time].[Month]
Most of the time though, future months are present in the Month data item. So another technique to use is:
II. Create an attribute that will have a value of ‘Y’ if the member is the current Month. Something like:
timedimsource
Set this attribute as the Member Description in the month level of your time dimension then publish your package.
cy attribute
In your report you can use the RoleValue function together with filter to obtain the member with the ‘Y’ value, which is the current month (or more accurately the member which value is the same as the current month).
rolevalueexpression

No comments:

Post a Comment