dbTalk Databases Forums  

Dynamic Financial Year MDX

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Dynamic Financial Year MDX in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
chrisb@targit.co.nz
 
Posts: n/a

Default Dynamic Financial Year MDX - 04-03-2005 , 08:51 PM






I am trying to generate a new Calculated Member that contains the value
for the 'Current Financial Year' using the following code:

iif(
IsAncestor([FinPeriod].CurrentMember,strtomember("[FinPeriod].[Year].&["
+ CStr(Year(Now())) + "]").FirstChild),
(strtomember("[VectorFinPeriod].[Year].&[" + CStr(Year(Now())) +
"]"),[Dynamic Dates].[All Dates]),
iif(
IsAncestor(strtomember("[FinPeriod].[Year].&[" + CStr(Year(Now())) +
"]"), [FinPeriod].CurrentMember),
[Dynamic Dates].[All Dates],
null
))

This worked fine until April 1st roled by and now my financial year
still related to the previous one.

My FinPeriod dimension starts on the 1st April.

What I need is to be able to take into account that Apr - Dec of any
given year is actually the current year +1 to give me the financial
year. But that Jan, Feb and March are simply the current year derived
from the NOW function.

Does anyone have any idea on how to go about this? It's driving me
mad.

Thanks


Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: Dynamic Financial Year MDX - 04-05-2005 , 07:39 AM






why you don't use a property in your finperiod dimension ?

a property like "Current FYear" (which is 0 or 1), and then, simply filter
your dimension to take the members with his property set to 1.

<chrisb (AT) targit (DOT) co.nz> wrote

Quote:
I am trying to generate a new Calculated Member that contains the value
for the 'Current Financial Year' using the following code:

iif(
IsAncestor([FinPeriod].CurrentMember,strtomember("[FinPeriod].[Year].&["
+ CStr(Year(Now())) + "]").FirstChild),
(strtomember("[VectorFinPeriod].[Year].&[" + CStr(Year(Now())) +
"]"),[Dynamic Dates].[All Dates]),
iif(
IsAncestor(strtomember("[FinPeriod].[Year].&[" + CStr(Year(Now())) +
"]"), [FinPeriod].CurrentMember),
[Dynamic Dates].[All Dates],
null
))

This worked fine until April 1st roled by and now my financial year
still related to the previous one.

My FinPeriod dimension starts on the 1st April.

What I need is to be able to take into account that Apr - Dec of any
given year is actually the current year +1 to give me the financial
year. But that Jan, Feb and March are simply the current year derived
from the NOW function.

Does anyone have any idea on how to go about this? It's driving me
mad.

Thanks




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.