Hello,
We are trying to use the following formula to separate the payable and receivable amounts if they are greater or less than zero, however there is a parse error. A new column should be created indicating if the entry is a payable or receivable based on the signage of the original amount column.
Thank you
Hi @thalil
Couple of things don't look quite right in the screenshot. First of all you can't have two separate if statements in the same single formula, and they aren't structured quite correctly. I believe you'd want something like:
If [Original Amount] > 0 then "BankCorp Payable"
elseif [Original Amount] < 0 then "BankCorp Receivable"
else '0'
endif
That is 2 if statements in the same formula...
Is this what you want to do? It will leave it blank if the Amount field is also empty
if [Original Amount] >0 then "Bankcorp Payable"
elseif
[Original Amount]<0 then "Bankcorp Receivable"
else
""
endif
@thalil check the data type of the [Original Amount] field. My guess is that it's a string so can't be compared against 0, so you'll need to change it to a numeric data type, such as double.
@thalil - check to see if there is a line break in the "Bankcorp Receivable" that you wrote in the formula tool.
It looks like it is just wrapping for lack of available space, but I am wondering if you accidentally hit enter to get to the second line?
Not sure that will solve it but it is worth a shot.
Try wrapping the 0s in the formula in quotes too. If that works than there is still an issue with the data type coming into the formula.
Thank you! I just tried this and the formula is working!