I am basically trying to replicate IF(ABS(D4)>(E2),"Yes", "No") this formula in my survey.
Values captured in the fields D4 and E2 has been populated from different calculation which can be positive or negative, Irrespective of that it should populate the result as Yes or No.
Thanks for the help in advance.
Anu
Hi Anu,
There isn't an abs() function directly supported in Survey123. It can be done, however with an if statement:
if(${q} < 0, -1*${q}, ${q})
Sorry James, but you would be able to elaborate more?
Sure,
The if() statement looks to see if the value of the question is less than 0. If it is, it multiplies it by -1, resulting in a positive value the same distance away from 0. If it is not, it returns the value, which is either 0 or a positive number. The result is that you always get a positive number or 0.
Thanks James, its working exactly the same way I wanted it.
Anu