Skip to Content
0

BPC script logic several rules

Mar 14, 2017 at 09:42 AM

117

avatar image
Former Member

Hi,

I used Calc_Account and Copy_Opening business rules. My script logic likes below:

*SELECT(%Y%,[YEAR],TIME,[ID]=%TIME_SET%)
*SELECT(%TID%,[TIMEID],TIME,[ID]=%TIME_SET%)
*SELECT(%PERIOD%,[ID],TIME,[YEAR]=%Y% AND [CALC]=N AND [TIMEID]>=%Y%1200)
*SELECT(%CATEG%,[ID],CATEGORY,[BEHAVI]=Y,L AND [CALC]=N)

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = ACTUAL
CURRENCY = LC
TID_RA = TMVL(-1,%TIME_SET%)
OTHER = [ENTITY=%ENTITY_SET%]
CALC = a1
*ENDRUN_PROGRAM
*COMMIT

*RUN_PROGRAM CALC_ACCOUNT
CATEGORY = BUDGET
CURRENCY = LC
TID_RA = %TIME_SET%
OTHER = [ENTITY=%ENTITY_SET%]
CALC = a2
*ENDRUN_PROGRAM

*FOR %TIM% = %PERIOD%
*FOR %CAT% = %CATEG%
*RUN_PROGRAM COPYOPENING
CATEGORY = %CAT%
CURRENCY = LC
TID_RA = %TIM%
OTHER = [ENTITY=%ENTITY_SET%]
*ENDRUN_PROGRAM
*NEXT
*NEXT

Data Manager Package Parameters are: TIME=2017.01 and ENTITY=A672. And bpc will run 3 task above.

My Question is: why COPYOPENING can not run and no error message ? We have data and if I split that code to be 3 script logic file and DM package, BPC can send data.

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

9 Answers

Vadim Kalinin Mar 14, 2017 at 09:55 AM
0

What do you mean by this line:

*SELECT(%PERIOD%,[ID],TIME,[YEAR]=%Y% AND [CALC]=N AND [TIMEID]>=%Y%1200)

PERIOD will be last month of the year? Strange...

And

*SELECT(%TID%,[TIMEID],TIME,[ID]=%TIME_SET%)

%TID% is not used...

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 14, 2017 at 11:46 AM
0

Hi Vadim,

I only want to user fill in 2017.01 and bpc will do 3 tasks above. For last task needs time parameter 2017.02 untill 2017.dec and 2018.02 until 2018.dec, user do not have to fill in that parameter.

Thanks.

Share
10 |10000 characters needed characters left characters exceeded
Vadim Kalinin Mar 14, 2017 at 12:03 PM
0

"For last task needs time parameter 2017.02 untill 2017.dec and 2018.02 until 2018.dec, user do not have to fill in that parameter" - sorry, but not clear!

If the user select 2017.02 as %TIME_SET%

For which periods do you want to perform COPYOPENING?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 14, 2017 at 12:27 PM
0

user selected 2017.01 for %time_set% and bpc will copy start from 2017.02 untill 2018.dec. Script will perform copyopening.

Share
10 |10000 characters needed characters left characters exceeded
Vadim Kalinin Mar 14, 2017 at 12:32 PM
0

Just to check again (because your script will not do wat you want)!

%TIME_SET% - 2017.01

COPYOPENING - 2017.02...2017.12,2018.01...2018.12

and for

%TIME_SET% - 2017.02

COPYOPENING - 2017.03...2017.12,2018.01...2018.12

all months after the next month of the year selected by user and all months of the next year?

Is it correct?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 14, 2017 at 12:48 PM
0

Hi Vadim,

User will only select 2017.01 now. And I wish bpc will know 2017.02 till 2018.dec to perform copyopening. Package will run one time for all months.

Share
10 |10000 characters needed characters left characters exceeded
Vadim Kalinin Mar 14, 2017 at 01:09 PM
0

"User will only select 2017.01 now" - sorry, but what will the user select next time??? It's strange to have script to work only for one month!

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 14, 2017 at 03:00 PM
0

Maybe, can you please advise my script? Lets say, to retrieve 2017.feb untill 2017.dec?

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

Sorry, but if you are unable to define absolutely clear requirements then I can't help you - just a waste of time.

You have to explain what the user will provide to the script: any single month?

Like 2017.01 or 2017.02 or ...

And depending on the month provided by user what will be the periods that COPYOPENING will run!

Is it a real business case or just a training sample for some test?

0
Vadim Kalinin Mar 14, 2017 at 04:26 PM
0

Sample script that will select all base periods starting after some month selected by user and ending including December of next year:

*SELECT(%Y%,[YEAR],TIME,[ID]=%TIME_SET%)
*SELECT(%TID%,[TIMEID],TIME,[ID]=%TIME_SET%)
*SELECT(%TIDYDEC%,[TIMEID],TIME,[YEAR]=%Y% AND [MONTHNUM]=12 AND [CALC]=N)
*SELECT(%TIDNEXTYS%,[TIMEID],TIME,[TIMEID]>%TIDYDEC% AND [CALC]=N)
*SELECT(%NEXTY%,[YEAR],TIME,[TIMEID]<=%TIDNEXTYS% AND [TIMEID]>%TIDYDEC% AND [CALC]=N)
*SELECT(%TIDNEXTYDEC%,[TIMEID],TIME,[YEAR]=%NEXTY% AND [MONTHNUM]=12 AND [CALC]=N)
*SELECT(%PERIOD%,[ID],TIME,[TIMEID]<=%TIDNEXTYDEC% AND [TIMEID]>%TID% AND [CALC]=N)
*XDIM_MEMBERSET TIME=%PERIOD%

For example: %TIME_SET%=2014.04

Then %PERIOD% will be:

*XDIM_MEMBERSET TIME=2014.05,2014.06,2014.07,2014.08,2014.09,2014.10,2014.11,2014.12,2015.01,2015.02,2015.03,2015.04,2015.05,2015.06,2015.07,2015.08,2015.09,2015.10,2015.11,2015.12

Share
10 |10000 characters needed characters left characters exceeded