Skip to Content
avatar image
Former Member

SAP BPC Script logic issue

Hello All, I am trying to sum couple of accounts and add to existing value in different account & intersection for ex:

A=100, B=50,C=100 D=500 expected result in D = 750 ( Datasource, Account, Reporting line are different)

But after executing following script I am getting 750+500 = 1250 in Account D. It looks like it is not overwriting the new value(750) in destination.

*XDIM_MEMBERSET ACCOUNT=A,B,C
*XDIM_MEMBERSET DATASOURCE=INPUT
*XDIM_MEMBERSET REPORTINLINE=R1
*WHEN REPORTINGLINE
*IS R1
*REC(EXPRESSION=%VALUE% + ([REPORTINGLINE].[R2],[DATASOURCE].[ADJUST],[ACCOUNT].[D]),ACCOUNT=D,DATASOURCE=ADJUST,REPORTINGLINE=R2)
*ENDWHEN
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Jan 09 at 09:23 PM

    You can use the following script:

    //Scope everything
    *XDIM_MEMBERSET DATASOURCE=INPUT,ADJUST
    *XDIM_MEMBERSET REPORTINLINE=R1,R2
    *XDIM_MEMBERSET ACCOUNT=A,B,C,D
    
    *WHEN DATASOURCE
    *IS INPUT
      *WHEN REPORTINLINE
      *IS R1
        *WHEN ACCOUNT
        *IS A,B,C
          *REC(EXPRESSION=%VALUE%,ACCOUNT=D,DATASOURCE=ADJUST,REPORTINGLINE=R2)
        *ENDWHEN
      *ENDWHEN
    *IS ADJUST
      *WHEN REPORTINLINE
      *IS R2
        *WHEN ACCOUNT
        *IS D
          *REC(EXPRESSION=%VALUE%,ACCOUNT=D,DATASOURCE=ADJUST,REPORTINGLINE=R2)
        *ENDWHEN
      *ENDWHEN
    *ENDWHEN
    

    This script will read input data and aggregate it in D, ADJUST, R2

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09 at 08:24 PM

    Please show the existing data with all dimensions provided. Not only Account!

    "Datasource, Account, Reporting line are different" - explain this statement.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09 at 09:01 PM

    Hello Vadim, Here is the sample data.

    Account DATSOURCE REPORTINGLINE 
    A       INPUT     R1        100
    B       INPUT     R1	     50
    C       INPUT     R1        100
    D       ADJUST    R2        500
    
    Expected result:
    Account DATSOURCE REPORTINGLINE
    D       ADJUST    R2        750
    
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09 at 11:07 PM

    Thanks Very much Vadim. I got the expected result.

    Add comment
    10|10000 characters needed characters exceeded