on 10-13-2014 5:37 AM
Hi Team,
I'm trying to use nested if condition using CE, below is my formula
CE_CALC(' if "Field1" = 0, 0, if "Field2" > "Field3", ( ("Field2" - "Field3") * "Field4" * -1 ), 0 ) ', DECIMAL(17,3)) AS "V_TEMP"
it is not returning the correct result. When I use the same condition in SQL Script, it is working fine. Is it possible to use nested if using CE function?
Thanks
Sathish
Hi Sathish,
If aren't being used correctly due to missing parenthesis.
CE_CALC(' if("Field1" = 0.0, 0.0, if("Field2" > "Field3", ( ("Field2" - "Field3") * "Field4" * -1 ), 0.0 )) ', DECIMAL(17,3)) AS "V_TEMP"
Also use 0.0 instead 0 as it's a decimal field and you avoid implict conversions.
Regards, Fernando Da Rós
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.