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

Script logic multiply issue

0 Kudos
287

Hi,

I have a script logic in which I tested A + B = C (A = -10, B=3, C=-7); the result is correct. However, once I change the operator from "+" to "*", i.e A * B, the system generates 0.00 record. I find it weird why the result is 0 when the source members are having values. (System: BPC 11 BPC4HANA SP level 7)

*REC(EXPRESSION = ([ACCOUNT].[ST_SALES_PRICE_DOM]+([ACCOUNT].[ST_SALES_VOLUME_DOM])), ACCOUNT = 11060001, PLANT = P_NONE, PROFIT_CENTRE = PC_NONE, AUDITTRAIL = PLAN_CALCULATED). Result = -7

vs

*REC(EXPRESSION = ([ACCOUNT].[ST_SALES_PRICE_DOM]*([ACCOUNT].[ST_SALES_VOLUME_DOM])), ACCOUNT = 11060001, PLANT = P_NONE, PROFIT_CENTRE = PC_NONE, AUDITTRAIL = PLAN_CALCULATED). Result = 0

Any possible reasons why this is happening?

Thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hi Vadim,

Could you advice on a more efficient manner of scoping, to prevent 0 record combination?
Thanks.

former_member186338
Active Contributor
0 Kudos

It's not about efficient manner of scoping! You have to provide full info according to

https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

You have to show report with all dimensions visible with existing data values. And to explain the required logic!

0 Kudos

Hi Vadim,

Thanks for explanation! So I believed, the way to resolve this is to be very specific on the members required for calculation..

former_member186338
Active Contributor
0 Kudos

Very easy to understand! You are not looking on other dimensions!

ACCOUNT: ST_SALES_PRICE_DOM

DIMx: MEMBER1

VALUE: -10

ACCOUNT: ST_SALES_PRICE_DOM

DIMx: MEMBER2

VALUE: 0

.

ACCOUNT: ST_SALES_VOLUME_DOM

DIMx: MEMBER2

VALUE: 3

ACCOUNT: ST_SALES_VOLUME_DOM

DIMx: MEMBER1

VALUE: 0

If you sum, then due to accumulation the result will be -7

-10+0=-10

3+0=3

Accumulation: -10+3=-7

But if you multiply the you will have 2 records, each resulting in 0!

-10*0=0

0*3=0

former_member186338
Active Contributor
0 Kudos

Is it clear?