Skip to Content
0
Dec 18, 2008 at 12:06 PM

MDX syntax for current year in a Pre-defined condition

68 Views

Hi,

I'm looking for assistance in building a Pre-defined condition in a universe based on an MSAS 2005 OLAP cube, that only returns the current year.

My year is defined as [Time Accounting].[Accounting].[Accounting Year]

I can create a Pre-defined filter that accepts a constant value as follows:

<FILTER KEY="[Time Accounting].[Accounting].[Accounting Year]">

<CONDITION OPERATORCONDITION="Equal">

<CONSTANT CAPTION="2008"/>

</CONDITION>

</FILTER>

and it works fine, however, I would like to make it dynamic.

There is an attribute called current year that is defined as [Time Accounting].[Accounting Year].[Accounting Year].[Current Year].[Value] but when I try and put this into my pre-defined filter nothing is returned:

<FILTER KEY="[Time Accounting].[Accounting].[Accounting Year]">

<CONDITION OPERATORCONDITION="Equal">

<CONSTANT CAPTION="[Time Accounting].[Accounting Year].[Accounting Year].[Current Year].[Value]"/>

</CONDITION>

</FILTER>

Is this possible? What am I doing wrong?

What I'm ultimately aiming for is a rolling 12 month condition.

Thanks,

Colin