cancel
Showing results for 
Search instead for 
Did you mean: 

Greater Than Function in Script Logic File

Former Member
0 Kudos

BPC Experts,

I've got a pretty simple script logic file to calculate salary amounts, overtime, etc. The purpose of this logic is for forecasting. I have two referenced dimensions, TIME and SCENARIO, where TIME.MONTHNUM is equal to its relative month number (eg: Jan monthnum = 1), and SCENARIO.CURRMONTH is equal to the relative amount of actual months data, (eg Jan currmonth = 0, Feb = 1) because if you are completing a February forecast, you have one month of actual.

The ACTUAL scenario is never touched, but after a month closes, we copy the ACTUAL data to, for example, FEB_FCST. So, after January closes, its actuals are copied to the FEB_FCST scenario so we can complete an actual/forecast (one month actual, 11 months forecast).

Currently, the default logic skips anything in the ACTUAL scenario, by stating "*WHEN SCENARIO, *IS <> "ACTUAL" yada yada yada.

However, when the default logic runs on the forecast scenarios, it takes the same inputs from the months that are copied over from the ACTUAL scenario and adds to the original amount, essentially doubling the value--ultimately causing an incorrect actuals number in the forecast scenario.

My script right now looks like this:

*XDIM_MEMBERSET DATASRC=INPUT

*XDIM_MEMBERSET PRODUCT=NO_PRODUCT

*XDIM_MEMBERSET SHIFT=NO_SHIFTS

*XDIM_MEMBERSET MEASURES=PERIODIC

*WHEN SCENARIO

*IS <> "ACTUAL"

*WHEN TIME.MONTHNUM

*IS > SCENARIO.CURRENTMNTH

*WHEN ACCOUNT

*IS "SALARIED_MANPOWER"

*REC(EXPRESSION=((([ACCOUNT].[SALARIED_AVG_WAGE] * (1 + [ACCOUNT].[SALARY_TIMEAHALF]))* [ACCOUNT].[SALARIED_MANPOWER])),ACCOUNT="01100")

*ENDWHEN

*ENDWHEN

*ENDWHEN

*COMMIT

When it hits line 9 (*IS > SCENARIO.CURRENTMNTH) during validation, it errors. How can I use a "greater than" function to dictate whether or not a given scenario should run default logic on a specific month?

If not, is there a different/better way to do it?

Thank you!

ABF

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Alex,

I misread your original message.

To be honest in this situation it may be worth creating a dummy account e.g. COPY_ACTUAL. Then create a simple input schedule whereby you enter the value 1 against the periods that require you to copy actuals data. You can then reference this dummy account in your REC statement.

This is hardly the most dynamic of solutions but should be simple to maintain from an end-user perspective. If most of your versions are period specific you could set up the values in advance.

Cheers

Stuart

Edited by: Stuart Hooker on May 28, 2011 4:32 AM

Former Member
0 Kudos

Hi Alex,

Try looking at the examples provided in the script logic primer written by Sheldon Edelstein (pages 9 and 25)

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e025fa8d-1c22-2e10-cd9f-c488c7eeadd4

Cheers

Stuart

Former Member
0 Kudos

Hi Alex

Take this sample logic, check the properties in your Time dimension to trouble shoot your issue.

*SELECT(%CAT_VAR%, "ID", CATEGORY, ID= PLAN_APRIL)

*XDIM_MEMBERSET CATEGORY = ACTUAL, PLAN, %CAT_VAR%

*SELECT(%CATMTH%, "STARTMTH", CATEGORY, ID= %CAT_VAR%)

*SELECT(%ACT_PERIOD%, "ID", TIME, MONTHNUM < %CATMTH% AND LEVEL = MONTH AND YEAR = 2010)

*SELECT(%PLAN_PERIOD%, "ID", TIME, MONTHNUM >= %CATMTH% AND LEVEL = MONTH AND YEAR = 2010)

*XDIM_MEMBERSET TIME= %ACT_PERIOD%

*XDIM_MEMBERSET CATEGORY=ACTUAL

*WHEN CATEGORY

*IS ACTUAL

*REC(EXPRESSION=%VALUE%, CATEGORY = %CAT_VAR%)

*ENDWHEN

*XDIM_MEMBERSET TIME= %PLAN_PERIOD%

*XDIM_MEMBERSET CATEGORY=PLAN

*WHEN CATEGORY

*IS PLAN

*REC(EXPRESSION=%VALUE%, CATEGORY = %CAT_VAR%)

*ENDWHEN

Thanks

Former Member
0 Kudos

I am not sure if this would help you. But this is how we use in script logic

If the record's value is greater than 10,000

(%VALUE% > 10000)

Regards,

Sanjeev