Guys, please help me in correcting the formula. Below is the data
I have this formula "Results = IF PRICE 1 = 0 THEN 0 ELSEIF
IS(NULL) ([PRICE1]) THEN "ERROR" ELSE PRICE1 - PRICE2 ENDIF
Pease advise how to fix this if Error is states "the formula in Price1 resulted to string format. Use to number..."
Thanks,
Kamen
Solved! Go to Solution.
Your code is throwing a different error when I try it, likely because of incorrect syntax (e.g. "IS(NULL)" doesn't work).
Try the code below. It works for me when using your sample data:
HI @Peachyco
Appreciate your response. What if the Results field data type is fixed decimal with 2 decimal points. Can you still produce the "error" condition. I would like to convert the result into 2 decimal points. If you any more ideas, please share.
Looking forward for your response.
thanks,
Kamen
Hi @KamenRider,
You can convert [Price 1] into 2 decimal points using ToNumber function. That is, ToNumber([Price1]), then change the data type and size accordingly.
Hope this helps.
Cheers,
Lelia
If you want the numeric outputs to take the template "0.00", then you can wrap the numeric outputs with the ToString ([Number], 2) function, like so (the second parameter "2" tells the function to keep two decimal places):
We can't assign FixedDecimal or any numeric type to the [Result] column if we want "ERROR" to be there as well - it has to be a string.