cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to create script logic based on number of time periods

Former Member
0 Kudos
157

Hi,

We have below requirement to create script logic based on number of time periods

We are going to run the script for the below selection

Category = PLAN

Planyear = 2016

Time = 2016.02 to 2017.07 (18months) as feb is the current month we are going to run from current time period

The account WM_FT_GROSS_RATE should be same as WM_FT_GROSS_AMT for the first 12 months forecasting and from 13th to 18th month it should be WM_FT_GROSS_RATE /12

So,

*XDIM_MEMBERSET ACCOUNT = WM_FT_GROSS_RATE

*XDIM_MEMBERSET TIME = %TIME_SET%

Considering above requirement, who to execute first WHEN condition to all time members from 2016.02 to 2017.01 and second WHEN condition for the time periods 2017.02 to 2017.07.

*WHEN ACCOUNT

*IS WM_FT_GROSS_RATE

*REC(FACTOR=1, ACCOUNT = WM_FT_GROSS_AMT)

*ENDWHEN

*WHEN ACCOUNT

*IS WM_FT_GROSS_RATE

*REC(EXPRESSION=%VALUE%/12, ACCOUNT = WM_FT_GROSS_AMT)

*ENDWHEN

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

Please read

And provide additional info including data sample, user input prompt selection etc...

Vadim

Former Member
0 Kudos

Data Manager package will be executed with below dimensions

Category = PLAN

Planyear = 2016

time = 2016.02,2016.03,2016.04,2016.05.....2017.07

former_member186338
Active Contributor
0 Kudos

Sorry, please don't copy paste your original message and spend some time to clearly explain your requirements!

Former Member
0 Kudos

I am not sure if you have understood my requirement, when the user tries to run the script with the above dimension values

This WHEN statement should be applicable for the first 12 time periods

*WHEN ACCOUNT

*IS WM_FT_GROSS_RATE

*REC(FACTOR=1, ACCOUNT = WM_FT_GROSS_AMT)

*ENDWHEN

And the below WHEN statement should be applicable for the last 6 time periods

*WHEN ACCOUNT

*IS WM_FT_GROSS_RATE

*REC(EXPRESSION=%VALUE%/12, ACCOUNT = WM_FT_GROSS_AMT)

*ENDWHEN

WM_FT_GROSS_AMT is the same amount as of WM_FT_GROSS_RATE for the first 12 months of forecasting and its /12 value for the last 6 months of the forecasting time periods

Is there any way to achieve this????

former_member186338
Active Contributor
0 Kudos

What do you mean by "for the first 12 time periods" - first starting from? Is it from current month or?

Can you also show data sample? Calculations looks strange...

Former Member
0 Kudos

Its is from the current month the script runs..in the above case its 2016.02.

former_member186338
Active Contributor
0 Kudos

Sorry, but "Its is from the current month the script runs" - BPC has no internal functionality to determine "the current month the script runs" (may be some badi only).

If you are talking about user selection - the the user has to select SINGLE month and the script will assume it as current...

Is it correct?

former_member186338
Active Contributor
0 Kudos

Script like:

// Assuming %TIME_SET% = 2016.02

*XDIM_MEMBERSET TIME = %TIME_SET%,TMVL(1,%TIME_SET%),TMVL(2,%TIME_SET%),...,TMVL(11,%TIME_SET%)

//12 months scoped 2016.02,...,2017.01

...

*XDIM_MEMBERSET TIME = TMVL(12,%TIME_SET%),TMVL(13,%TIME_SET%),...,TMVL(17,%TIME_SET%)

//6 months scoped 2017.02,...,2017.07

Vadim

Former Member
0 Kudos

Thank you for your kind reply, I tried testing the above thing, but as per my current scenario the user will give 18 months time periods in the selection screen because the script should run for 18 months forecasting data updation.

Here is the Data region from UJKT

CATEGORY = PLAN

PLANYEAR = 2015

TIME = 2015.10,2015.11,2015.12,2016.01,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07,2016.08,2016.09,2016.10,2016.11

Script

*XDIM_MEMBERSET ACCOUNT = WM_FT_GROSS_RATE

*XDIM_MEMBERSET COSTCTR = CC_3185

*XDIM_MEMBERSET TIME = %TIME_SET%,TMVL(1,%TIME_SET%),TMVL(2,%TIME_SET%),TMVL(3,%TIME_SET%),TMVL(4,%TIME_SET%),TMVL(5,%TIME_SET%),TMVL(6,%TIME_SET%),TMVL(7,%TIME_SET%),TMVL(8,%TIME_SET%),TMVL(9,%TIME_SET%),TMVL(10,%TIME_SET%),TMVL(11,%TIME_SET%)

*WHEN ACCOUNT

*IS WM_FT_GROSS_RATE

*REC(FACTOR=1, ACCOUNT = WM_FT_GROSS_AMT)

*ENDWHEN

*COMMIT

*XDIM_MEMBERSET ACCOUNT = WM_FT_GROSS_RATE

*XDIM_MEMBERSET COSTCTR = CC_3185

*XDIM_MEMBERSET TIME = TMVL(13,%TIME_SET%),TMVL(14,%TIME_SET%)

*WHEN ACCOUNT

*IS WM_FT_GROSS_RATE

*REC(EXPRESSION=%VALUE%/12]), ACCOUNT= WM_FT_GROSS_AMT)

*COMMIT

BUT THE SECOND WHEN CONDITION NEVER TRIGGERED

former_member186338
Active Contributor
0 Kudos

"user will give 18 months time periods in the selection screen because the script should run for 18 months forecasting data updation" - incorrect idea! Only current month input!

former_member186338
Active Contributor
0 Kudos

P.S. Remove also useless COMMIT!

Former Member
0 Kudos

No luck

former_member186338
Active Contributor
0 Kudos

Then you are doing something wrong... Like no data available for second WHEN/ENDWHEN!

Former Member
0 Kudos

Hi

I noticed you may have a few syntax errors in your second statement:

Instead of:

*WHEN ACCOUNT

*IS WM_FT_GROSS_RATE

*REC(EXPRESSION=%VALUE%/12]), ACCOUNT= WM_FT_GROSS_AMT)

*COMMIT

Try:

*WHEN ACCOUNT

*IS WM_FT_GROSS_RATE

*REC(EXPRESSION=%VALUE%/12, ACCOUNT= WM_FT_GROSS_AMT)

*ENDWHEN

*COMMIT

Regards,

Jack

former_member186338
Active Contributor
0 Kudos

Hi Jack,

I think it's just retyping error The script with "=%VALUE%/12]), ACCOUNT" will not validate!

Vadim

Former Member
0 Kudos

Ahh, I thought it may have been a typo!

Cheers Vadim