on ‎2020 Dec 16 1:51 PM
Hi,
I have a if nested key figure calculation with as below.
Depending on the attribute CUSTID, the key figure QUANTITYTOTAL is divided into either Keyfigure1 or (Keyfigure2+Keyfigure3).
It works fine:
IF(UPPER("CUSTID") =''BP1010', "QUANTITYTOTAL@ZMATLOCDIVCUST" / "Keyfigure1@ZMATLOCDIV", IF(UPPER("CUSTID")=''BP1710'',"QUANTITYTOTAL@ZMATLOCDIVCUST" / ("Keyfigure2@ZMATLOCDIV" + "Keyfigure3@ZMATLOCDIV"),NULL))
But I also have to make sure that Keyfigure1 and (Keyfigure2+Keyfigure3) are not empty or zero to avoid dividing by 0 or NULL.
IF((UPPER("CUSTID")=''BP1010''), (IF(ISNULL("Keyfigure1@ZMATLOCDIV") OR "Keyfigure1@ZMATLOCDIV"=0, 0, ("QUANTITYTOTAL@ZMATLOCDIVCUST" / "Keyfigure1@ZMATLOCDIV"))), (IF((UPPER("CUSTID")=''BP1710''), (IF(ISNULL(("Keyfigure2@ZMATLOCDIV" + "Keyfigure3@ZMATLOCDIV")) OR ("Keyfigure2@ZMATLOCDIV" + "Keyfigure3@ZMATLOCDIV")=0)), 0,"QUANTITYTOTAL@ZMATLOCDIVCUST" / ("Keyfigure2@ZMATLOCDIV" + "Keyfigure3@ZMATLOCDIV"), NULL)))
The check of planning area is ok, but I get a error message with the planning area activation.
SQL Message: column store error: fail to create scenario: [34011] Inconsistent calculation model;calculationNode
expression: Expression is not valid: Evaluator: wrong number of function arguments;wrong number of args to if,fixed
How do I need to write the IF Nested Calculation, so it would work?
Thanks
Request clarification before answering.
Hi Kenon,
Please check the below code.
IF(UPPER("CUSTID")=''BP1010'', IF(ISNULL("Keyfigure1@ZMATLOCDIV") OR "Keyfigure1@ZMATLOCDIV"=0, 0, "QUANTITYTOTAL@ZMATLOCDIVCUST" / "Keyfigure1@ZMATLOCDIV"),IF(UPPER("CUSTID")=''BP1710'',IF(ISNULL("Keyfigure2@ZMATLOCDIV" + "Keyfigure3@ZMATLOCDIV") OR ("Keyfigure2@ZMATLOCDIV" + "Keyfigure3@ZMATLOCDIV")=0, 0,"QUANTITYTOTAL@ZMATLOCDIVCUST" / ("Keyfigure2@ZMATLOCDIV" + "Keyfigure3@ZMATLOCDIV")), NULL))Best Regards,
Riyaz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 17 | |
| 16 | |
| 5 | |
| 3 | |
| 2 | |
| 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.