Skip to Content
0

MDX Function - Last Year Current - Time Dim - Daily

May 31, 2017 at 11:35 PM

132

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Vadim Kalinin Jun 01, 2017 at 06:04 PM
0

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

Show 7 Share
10 |10000 characters needed characters left characters exceeded

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

0
Juan Carlos Crespo Rojas

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

0

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.

0
Juan Carlos Crespo Rojas

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

0

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

Thanks again

0
Juan Carlos Crespo Rojas

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

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

Thanks again Vadim!

0