Skip to Content
avatar image
Former Member

BPC Script Logic Problem

System: NetWeaver 7.5, BPC 10.0

I'm struggling with a script that seems like it should be pretty easy.

It is easiest to describe the problem laying it out like an EPM report/input form.

Rows: various cost centers

Columns: 16 months - the farthest right month is the current month and the columns to the left work their way back.

There are two groupings of columns. 16 months for ACCOUNT_X and 16 months for ACCOUNT_Y.

For any given month, I need to calculate ACCOUNT_X * ACCOUNT_Y and save it to a third account ACCOUNT_Z.

The problem is that I only want the last positive value for each cost center written to ACCOUNT_Z. For example, if the current month is March, then I want March's value if it is positive. If it is not positive (ie. zero or negative), then I want the value in February and so on until I get to the first column. It's this requirement that is giving me fits.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    May 09, 2017 at 07:08 PM

    Please correct the primary tag! The correct is https://answers.sap.com/tags/01200615320800001016

    Second:

    You can use ternary operator to check for condition in REC

    Search for "Vadim ternary" I have explained it number of times.

    Add comment
    10|10000 characters needed characters exceeded

  • May 09, 2017 at 07:24 AM

    First - you have to change question tag - no relation to EPM add-in. Use bpc nw.

    Second - the explanation is not 100% clear, add some screenshot with initial values and calculation results. In general it's possible to check value to be positive but not possible to check if it's first positive.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2017 at 06:43 PM

    Thanks Vadim. I actually spent several minutes trying to find a BPC related tag. None appeared in the list, so I picked the closest thing I could find. I've included a screenshot that shows what I tried to describe. I want to only save the values in the rightmost column. I've spent the better part of today thinking about this problem and it boils down to one question. Can I use the value (maybe with a boolean comparison) to determine the destination intersection.

    I realize the pseudocode below will not work, but I'm hoping it makes my question more clear:

    *REC(EXPRESSION=(%VALUE%>0, then save to ACCOUNT_Z otherwise save to ACCOUNT_A))

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2017 at 07:38 PM

    I can't change the tag to anything BPC related. See attached image.

    Add comment
    10|10000 characters needed characters exceeded