Skip to Content
0

BPC Script Logic Problem

May 08, 2017 at 10:21 PM

74

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Vadim Kalinin May 09, 2017 at 07:08 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Vadim Kalinin May 09, 2017 at 07:24 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 09, 2017 at 06:43 PM
0

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))


example.png (6.5 kB)
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 09, 2017 at 07:38 PM
0

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


tags.png (15.4 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Unbelievable, is it so hard to copy the tag name from the link I post in my previous answer???

It's definitely not simply BPC :)

0