on 02-04-2014 1:29 PM
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?
Hi Natalija,
You can't use ABS, SIGN...
If you use BPC NW 7.5 or BPC NW 10 with JAVASCRIPT calculation engine you can use some Java Script functions. Look here: https://blogs.sap.com/2012/10/08/inline-rounding-in-rec-expression/
For BPC NW 10 with ABAP calculation engine you have no options...
B.R. Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Vadim
Thank you for clarification. Let's say BPC Script logic.
Maybe there is any option to make condition based on value, not on dimension member? For example we could just use -1 factor case the value is less than 0... I know something like that exists in Microsoft version, bet unfortunately we use BPC 10NW ABAP
Natalija
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
User | Count |
---|---|
13 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.