Hi!
I am struggling to find what is the problem in that simple IF statement and I would appreciate to have your help:
IF [Days Difference] = 'Out of scope' THEN 'Out of scope'
ELSEIF IsNull([Days Difference]) THEN 'x'
ELSEIF ToNumber([Days Difference]) <= '14' THEN 'Yes' ELSEIF 'No' ENDIF
The statement seems to be fine until I am entering the last value ENDIF. Before 'Formula', I used 'Sort' to be sure that 'Days Difference' column is in V_WString format. Also, I have tried to change the second and third 'ELSEIF' to 'ELSE' but then formula does not work at all.
In my data, the column 'Days Difference' contains numbers (1-30) and words for some rows (out of scope). The goal is to create a new column where numbers lower than 14 are marked as 'Yes', higher than 14 as 'No' and rows equal to 'out of scope' as 'out of scope'.
Can you help to solve this?
Thanks in advance,
IWWO
Solved! Go to Solution.
IF [Days Difference] = 'Out of scope' THEN 'Out of scope'
ELSEIF IsNull([Days Difference]) THEN 'x'
ELSEIF ToNumber([Days Difference]) <= 14 THEN 'Yes'
ELSE 'No' ENDIF
@IWWO I think this part of your formula is problematic:
ToNumber([Days Difference]) <= '14'
You're comparing a number to a string?
Lastly, the structure requires an ELSE at the end.
IF -> ELSEIF -> ELSE -> ENDIF or
IF -> ELSE -> ENDIF
All the best,
BS
Thanks you all for your help! The issue is solved. All the best!