cancel
Showing results for 
Search instead for 
Did you mean: 

MDX Function - Last Year Current - Time Dim - Daily

0 Kudos
433

Hi colleagues,

I wrote the following MDX funtion in order to get the Last Year based on the current period

*function PY(%KPI1%) 
(PARALLELPERIOD([AIC_TIEMPO_SEM].LEVEL00,1,AIC_TIEMPO_SEM].CURRENTMEMBER),%KPI1%) 
*endfunction

Example:

PY([AIC_T_VERSION].[ACTUAL]);SOLVE_ORDER=10

Member formula

Notes:

AIC_TIEMPO_SEM - Time dimension - DAY granularity

AIC_T_VERSION - Category dimension

Issue:

It works perfectly with non-leap years. Any workaround to solve this mdx when leap year would be helpfull

Version:

SAP BPC 10.0 NW

View Entire Topic
former_member186338
Active Contributor
0 Kudos

To my mind parallelperiod will not work on day level with leap years. Number of days is different...

0 Kudos

Thanks for the quick response Vadim, is there any other solution or have you faced a similar scenario?

former_member186338
Active Contributor
0 Kudos

I am unable to understand the required logic! What to do with February 29?

0 Kudos

For reporting purposes we need to present data as follows:

With non-leap years everything works fine.

When leap year, staring on 29 Feb (using the parallelperiod function) the Last Year Current doesn't present the correct data.

former_member186338
Active Contributor
0 Kudos

Sorry, but how is it possible to compare day with day if you have extra day in the leap year??? Logically impossible...

0 Kudos

That is precisely the issue with paralllelperiod function, is there any other approach to solve this inconsistency using MDX - member formula.

Thanks again

former_member186338
Active Contributor
0 Kudos

Sorry, but parallelperiod function assumes that you have equal number of periods on the required level. MDX don't think about days, it will simply count the number of periods from the beginning of the year! And this is by design.

You can create a property like PREVYEARDATE and fill it for all TIME members. Then try to use it with strtomember.

0 Kudos

Make sense to me, let me try and let you know.

Thanks again Vadim!