cancel
Showing results for 
Search instead for 
Did you mean: 

BPC Logic Issue

Former Member
0 Kudos

Hi,

I am trying to learn the script logic and facing this issue :

I want to calculate : ACCOUNT A = ACCOUNT B + ACCOUNT C.

FOR THIS I HAVE DEFINED THE SCRIPT LIKE THIS :

*XDIM_MEMBERSET CATEGORY = BUDGET

*XDIM_MEMBERSET TIME = %TIME_SET%

*WHEN ACCOUNT

*IS "B"

*REC(EXPRESSION = (%VALUE%)+[ACCOUNT].[C],ACCOUNT = "A")

*ENDWHEN

The code is getting validated successfully and when I am running it then following are the cases which I am getting :

In Excel Input Form if I enter : ACCOUNT B = 10 , ACCOUNT C = 10 THEN THE ACCOUNT A = 20 , which is correct and its working.

But when I enter the data in such way : ACCOUNT B =  ,ACCOUNT C = 10 ,ACCOUNT A = 0. It should show 10  but its not because I kept Account B blank this time.

So, my query is if above way is not correct then Please guide me how I can script : ACCOUNT A = ACCOUNT B + ACCOUNT C , so that it shows result in all condition even when any of the member account is blank .

Please guide.

Thanks

NATASHA

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

Hi Natasha,

2 WHEN/ENDWHEN loops required

If it's default.lgf then (no XDIM_MEMBERSET!):

*WHEN CATEGORY

*IS BUDGET

*WHEN ACCOUNT

*IS "B"

*REC(EXPRESSION = %VALUE%+[ACCOUNT].[C],ACCOUNT = "A")

*ENDWHEN

*ENDWHEN

*WHEN CATEGORY

*IS BUDGET

*WHEN ACCOUNT

*IS "C"

*REC(EXPRESSION = %VALUE%+[ACCOUNT].[B],ACCOUNT = "A")

*ENDWHEN

*ENDWHEN

If this script is DM package, then:

*XDIM_MEMBERSET CATEGORY = BUDGET

*XDIM_MEMBERSET ACCOUNT= B

*WHEN ACCOUNT

*IS *

*REC(EXPRESSION = %VALUE%+[ACCOUNT].[C],ACCOUNT = "A")

*ENDWHEN

*XDIM_MEMBERSET ACCOUNT= C

*WHEN ACCOUNT

*IS *

*REC(EXPRESSION = %VALUE%+[ACCOUNT].[B],ACCOUNT = "A")

*ENDWHEN

Vadim

former_member186338
Active Contributor
0 Kudos

P.S.

If you have to simply sum some accounts then:

For DM package the alternative script can be used (using WHEN/ENDWHEN accumulation):

*XDIM_MEMBERSET CATEGORY = BUDGET

*XDIM_MEMBERSET ACCOUNT= B,C

*WHEN ACCOUNT

*IS *

*REC(EXPRESSION = %VALUE%,ACCOUNT = "A")

*ENDWHEN

Vadim

Former Member
0 Kudos

Hi ,

So, in BPC there is no syntax to accept blank account members? Because for simple rules we need to create multiple scripts for the same rule just to make sure that rule works even when one of the account is blank.

former_member186338
Active Contributor
0 Kudos

The syntax exists:

*WHEN_REF_DATA = MASTER_DATA //loop all members including empty

To be placed before WHEN/ENDWHEN

But this statement affects all dimensions and the resulting performance will be terrible.

In most cases it's better to repeat WHEN/ENDWHEN loops.

Also, for DM package and simple sum of accounts you can use code in my second post (not for default.lgf)

Vadim