cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional execution of Account reclassication rule based on Time selection?

Former Member
0 Kudos

Hi Experts,

In our Consolidation implementation, we have used the Account Reclassication Business rule to perform Balance Carry Forward.

However, due to a client requirement, we ended with 2 sets of BCF rules.

One for Period 1 - ID: BCF_P1

The other for Periods 2-12 - ID: BCF_P2_12

Consequentially, at the moment, we have 2 BCF Data Manager Packages & 2 LGF files - 1 for P1 and the other for P2-12.

We were wondering if there is a way to merge these two into 1 single LGF file wherein the concerned "CALC=" entry in the script file is dynamic based on the time selection.

i.e. if the executed month is a Jan month - the *RUNPROGRAM syntax becomes CALC=BCF_P1 and if the executed month is other than a Jan month, it becomes CALC=BPC_P2_12

Any help/suggestions would be greatly appreciated!

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Yes, it's possible:

Lets assume that the user provide single month in %TIME_SET%

*SELECT(%P1%,[ID],TIME,ID=%TIME_SET% AND PERIOD=JAN) //Will be YYY.01 or nothing

*SELECT(%P2%,[ID],TIME,ID=%TIME_SET% AND PERIOD<>JAN) //Will be not YYY.01 or nothing

*FOR %P1S%=%P1%

*RUNPROGRAM...

...

CALC=BCF_P1

*NEXT

*FOR %P2S%=%P2%

*RUNPROGRAM...

...

CALC=BCF_P2_12

*NEXT

Vadim

former_member186338
Active Contributor
0 Kudos

To support multiple periods selection for single year:

*SELECT(%P1%,[ID],TIME,ID=%TIME_SET% AND PERIOD=JAN) //Will be YYY.01 or nothing

*SELECT(%P2%,[ID],TIME,ID=%TIME_SET% AND PERIOD<>JAN) //Will be not YYY.01 or nothing

*SELECT(%Y%,[YEAR],TIME,ID=%P2%)

*SELECT(%P3%,[ID],TIME,YEAR=%Y% AND PERIOD=JAN) //single member!

*FOR %P1S%=%P1%  // if JAN is in %TIME_SET%

*RUNPROGRAM...

...

TID_RA=%P1%

CALC=BCF_P1

*NEXT

*FOR %P3S%=%P3% //If not JAN in %TIME_SET%

*RUNPROGRAM...

...

TID_RA=%P2%

CALC=BCF_P2_12

*NEXT

Vadim

Former Member
0 Kudos

Thanks Vadim. Will check and revert!

former_member186338
Active Contributor
0 Kudos

Even more universal script for any combinations of periods in different years:

*SELECT(%P1%,[ID],TIME,ID=%TIME_SET% AND PERIOD=JAN)

*SELECT(%C1%,[CALC],TIME,ID=%P1%)

*SELECT(%P1S%,[ID],TIME,YEAR=2010 AND PERIOD=JAN AND CALC=%C1%) //single member!

*SELECT(%P2%,[ID],TIME,ID=%TIME_SET% AND PERIOD<>JAN)

*SELECT(%C2%,[CALC],TIME,ID=%P2%)

*SELECT(%P2S%,[ID],TIME,YEAR=2010 AND PERIOD=JAN AND CALC=%C2%) //single member!

*FOR %P1T%=%P1S%  // for JAN's is in %TIME_SET%

*RUNPROGRAM CALC_ACCOUNT

...

TID_RA=%P1%

CALC=BCF_P1

*ENDRUN_PROGRAM

*NEXT

*FOR %P2T%=%P2S%  // for not JAN's is in %TIME_SET%

*RUNPROGRAM CALC_ACCOUNT

...

TID_RA=%P2%

CALC=BCF_P2_12

*ENDRUN_PROGRAM

*NEXT

Former Member
0 Kudos

Thanks Vadim. The syntax worked wonderfully!

Answers (0)