Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Script logic error


I want to calculate sales %. The formula for sales % is as follows.

(Sales of the period last Yr + Sales of the period year prior to last year) / (total sales last yr + total sales of yr prior to last year)

In the my category dimension, I am storing the Year with Category budget. So the %YR% will be 2016. I am getting the error: Syntax Error: Missing  name after .operator.

Also when I run this code through Data manager package, I get the following error:

"An exception with the type CX_SY_CONVERSION_OVERFLOW occurred, but was neither handled locally, nor declared in a RAISING clause

Overflow converting from '1915814392984806400' "

Please help.


My code is as follows:



  *IS BAS("PC_1000")


  *IS 990000



  // BUDGET - Sales %

  *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(-24,%MYPER%)] + [TIME].[TMVL(-12,%MYPER%)]) / ([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(-12,%YR%.01)] + [TIME].[TMVL(-12,%YR%.02)] + [TIME].[TMVL(-12,%YR%.03)] + [TIME].[TMVL(-12,%YR%.04)] + [TIME].[TMVL(-12,%YR%.05)] + [TIME].[TMVL(-12,%YR%.06)] + [TIME].[TMVL(-12,%YR%.07)] + [TIME].[TMVL(-12,%YR%.08)] + [TIME].[TMVL(-12,%YR%.09)] + [TIME].[TMVL(-12,%YR%.10)] + [TIME].[TMVL(-12,%YR%.11)] + [TIME].[TMVL(-12,%YR%.12)])) * 100, TIME = TMVL(0,%MYPER%), ACCOUNT = "SALES_PERCENT", DATATYPE = "Z_PERCENTAGE", CATEGORY = "BUDGET", AUDITTRAIL = "SALES_PER_ADJ")






Hi Nicky,

You have an incorrect idea in general - to calculate KPI using script logic and store it in some member. Please, read Average percent values on nodes

And use dimension member formula for KPI calculation.


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question