on 11-17-2022 6:19 AM
Hi HANA Experts,
I am writing the multiple IF conditions in the calculated column.
IF("0DISTR_CHAN"= 'ES' OR "0DISTR_CHAN"= 'OL', "WY_RKF0011_WRYCWR06_CKF",
IF("0DISTR_CHAN"= 'RE' OR "0DISTR_CHAN"= 'EX', "INVOICED_SALES_FREECUR", ''))
The system is giving the error message as Expression is not valid: Evaluator: type error in expression evaluator;if("0DISTR_CHAN" = 'ES' or "0DISTR_CHAN" = 'OL', "WY_RKF0011_WRYCWR06_CKF", [here]if("0DISTR_CHAN" = 'RE' or "0DISTR_CHAN" = 'EX', "INVOICED_SALES_FREECUR", ''))(calculationNode (finalAggregation) -> attributes -> attribute (Invoiced_Sales) -> expression)
Hi jelina.masilamani ,
Can you try like below?
IF(("0DISTR_CHAN"= 'ES' OR "0DISTR_CHAN"= 'OL'), "WY_RKF0011_WRYCWR06_CKF", IF(("0DISTR_CHAN"= 'RE' OR "0DISTR_CHAN"= 'EX'), "INVOICED_SALES_FREECUR", ''))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your message.
I tried with your code in calculated column and getting the below error message.
Error Message
Repository: Encountered an error in repository runtime extension;Model inconsistency. Create Scenario failed:
Expression is not valid: Evaluator: type error in expression evaluator;if("0DISTR_CHAN" = 'ES' or "0DISTR_CHAN" = 'OL', "WY_RKF0011_WRYCWR06_CKF", [here]if("0DISTR_CHAN" = 'RE' or "0DISTR_CHAN" = 'EX', "INVOICED_SALES_FREECUR", ''))(calculationNode (finalAggregation) -> attributes -> attribute (Invoiced_Sales) -> expression)
Hi Abhi,
I copied the code and click on validate and save the changes. I am wondering, how it is not saving. I have deleted the calculated column and created with your code. But still same error. Do i need to clear anything. Pls suggest.
Error Message
Repository: Encountered an error in repository runtime extension;Model inconsistency. Create Scenario failed:
Expression is not valid: Evaluator: type error in expression evaluator;if("0DISTR_CHAN" = 'ES' or "0DISTR_CHAN" = 'OL', "WY_RKF0011_WRYCWR06_CKF", [here]if("0DISTR_CHAN" = 'RE' or "0DISTR_CHAN" = 'EX', "INVOICED_SALES_FREECUR", ''))(calculationNode (finalAggregation) -> attributes -> attribute (invoiced_Sales) -> expression)
The following errors occurred: Inconsistent calculation model (34011)
Details (Errors):
- calculationNode (finalAggregation) -> attributes -> attribute (invoiced_Sales) -> expression: Expression is not valid: Evaluator: type error in expression evaluator;if("0DISTR_CHAN" = 'ES' or "0DISTR_CHAN" = 'OL', "WY_RKF0011_WRYCWR06_CKF", [here]if("0DISTR_CHAN" = 'RE' or "0DISTR_CHAN" = 'EX', "INVOICED_SALES_FREECUR", '')).
Hi Abhi,
As i checked, the code is reflected but still it is showing same error. I changed from Column engine to SQL.
Error Message
Repository: Encountered an error in repository runtime extension;Model inconsistency. Create Scenario failed:
sql expression is not valid: 'IF(("0DISTR_CHAN"= 'ES' OR "0DISTR_CHAN"= 'OL'), "WY_RKF0011_WRYCWR06_CKF", IF(("0DISTR_CHAN"= 'RE' OR "0DISTR_CHAN"= 'EX'), "INVOICED_SALES_FREECUR", ''))' : Unregistered function name: "if"(calculationNode (finalAggregation))
The following errors occurred: Inconsistent calculation model (34011)
Details (Errors):
- calculationNode (finalAggregation): sql expression is not valid: 'IF(("0DISTR_CHAN"= 'ES' OR "0DISTR_CHAN"= 'OL'), "WY_RKF0011_WRYCWR06_CKF", IF(("0DISTR_CHAN"= 'RE' OR "0DISTR_CHAN"= 'EX'), "INVOICED_SALES_FREECUR", ''))' : Unregistered function name: "if".
No, it is not same error, if you check the new screenshot you have provided, this time you got a new error that says unregistered function 'if', which means you are using sql engine instead of column engine, change the engine to column in your calculated column definition, it will work.
BR,
Abhi
Hi Abhi,
I solved this problem. The data type of this calculated column is measure and i have given space in the else condition. I just included zero and it is working fine.
IF(("0DISTR_CHAN"= 'ES' OR "0DISTR_CHAN"= 'OL'), "WY_RKF0011_WRYCWR06_CKF", IF(("0DISTR_CHAN"= 'RE' OR "0DISTR_CHAN"= 'EX'), "INVOICED_SALES_FREECUR", 0))
User | Count |
---|---|
84 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.