Skip to Content
author's profile photo Former Member
Former Member

Help with Script logic

Hi,

We are working on SAP BPC 10.1 NW version on HANA. I need your help regarding script logic. I am executing the following code which get the Year from the Category dimension and then uses it in script logic to get the sum of sales 3 years prior and 2 years prior. It also gets the sum of sales for a particular period specified in the For loop 3 years and 2 years prior. When I executes the following code, it multiplies the value (sales) by 28 times sometimes 25 times etc.Please help!!! Kindly find attached the log files.

*SELECT(%YR%,"[YEAR]",CATEGORY,"[ID] = BUDGET")

*XDIM_MEMBERSET CATEGORY = ACTUAL

// *XDIM_MEMBERSET ACCOUNT = BAS(FS0132), BAS(FS0133)

*XDIM_MEMBERSET ACCOUNT = 400000

*XDIM_MEMBERSET PROFIT_CENTER = PC_101004, PC_101001

*XDIM_MEMBERSET DATATYPE=DT_CURRENCY

*XDIM_MEMBERSET COST_CENTER=CC_NONE

*XDIM_MEMBERSET INTERCO=I_NONE

*XDIM_MEMBERSET MEMBER_VENDOR AS %MEM% = BAS(MEMBER)

*WHEN ACCOUNT

*IS 400000

*WHEN PROFIT_CENTER

*IS PC_101004

*WHEN MEMBER_VENDOR

*IS %MEM%

*FOR %MYPER% = %YR%.01,%YR%.02,%YR%.03,%YR%.04,%YR%.05,%YR%.06,%YR%.07,%YR%.08,%YR%.09,%YR%.10,%YR%.11,%YR%.12

*REC(EXPRESSION = ([TIME].[TMVL(-36,%YR%.01)] + [TIME].[TMVL(-36,%YR%.02)] + [TIME].[TMVL(-36,%YR%.03)] + [TIME].[TMVL(-36,%YR%.04)] + [TIME].[TMVL(-36,%YR%.05)] + [TIME].[TMVL(-36,%YR%.06)] + [TIME].[TMVL(-36,%YR%.07)] + [TIME].[TMVL(-36,%YR%.08)] + [TIME].[TMVL(-36,%YR%.09)] + [TIME].[TMVL(-36,%YR%.10)] + [TIME].[TMVL(-36,%YR%.11)] + [TIME].[TMVL(-36,%YR%.12)] + [TIME].[TMVL(-24,%YR%.01)] + [TIME].[TMVL(-24,%YR%.02)] + [TIME].[TMVL(-24,%YR%.03)] + [TIME].[TMVL(-24,%YR%.04)] + [TIME].[TMVL(-24,%YR%.05)] + [TIME].[TMVL(-24,%YR%.06)] + [TIME].[TMVL(-24,%YR%.07)] + [TIME].[TMVL(-24,%YR%.08)] + [TIME].[TMVL(-24,%YR%.09)] + [TIME].[TMVL(-24,%YR%.10)] + [TIME].[TMVL(-24,%YR%.11)] + [TIME].[TMVL(-24,%YR%.12)]), TIME = TMVL(0,%MYPER%), ACCOUNT = "PRIOR_YR_SALES", MEMBER_VENDOR = "MV_NONE", DATATYPE = "DT_CURRENCY", CATEGORY = "BUDGET", AUDITTRAIL = "SEASONALITY_ADJ")

*REC(EXPRESSION = ([TIME].[TMVL(-36,%MYPER%)] + [TIME].[TMVL(-24,%MYPER%)]), TIME = TMVL(0,%MYPER%), ACCOUNT = "TWO_PRIOR_PERIOD_SALES", DATATYPE = "DT_CURRENCY", CATEGORY = "BUDGET", AUDITTRAIL = "SEASONALITY_ADJ", MEMBER_VENDOR = "MV_NONE")

*NEXT

*ENDWHEN

*ENDWHEN

*ENDWHEN

*COMMIT

LGX.txt.zip (2.2 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on May 19, 2015 at 08:30 AM

    Hi Glorida,

    First of all: "to get the sum of sales 3 years prior and 2 years prior" - not clear, what do you exactly mean?

    Looking on your code I am unable to understand what do you want to sum up and where to store result. Please show excel table with the desired calculation logic.

    Vadim

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.