Skip to Content

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

Using functions in MDX logic script

How can i use  MDX functions like ABS, SIGN etc. in logic scripts?

Actually, i would like to save always positive values for example for revenues.

The script could be like that:

*WHEN ACCOUNT.ACCTYPE

*IS EXP

    *REC(EXPRESSION = ABS(%VALUE%))

*ENDWHEN

*COMMIT

But this gives a validation error "RefferenceError: ABS is not defined".

Maybe there is some other way to save the absolute value or to change sign in case the value is negative?

Tags:
Former Member
replied

Hi Natalija,

The only conditional operator supported is ternary operator:

EXPRESSION or FACTOR=LogicalTest ? ExpressionIfTrue : ExpressionIfFalse

Like:

*REC(EXPRESSION=%VALUE%>0 ? %VALUE%*2 : 0)

If current value greater then zero then write current value multiplied by 2, else - write zero.

Fob BPC NW 10 with ABAP calculation engine nested ternary operator is not supported, with JAVASCRIPT calculation engine - nested is supported.

B.R. Vadim

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