Hello:
How can I transform the following IF conditional into alteryx?
X2=80 days
=IF(X2<7.99,"0-7 days",IF(X2<=30,"8-30 days",IF(X2<=60,"30-60 days",IF(X2<=90,"60-90 days",IF(X2<=120,"90-120 days",IF(X2<=180,"120-180 days","over 180 days"))))))
Thanks
Solved! Go to Solution.
See below example. For future reference, in the formula tool if you type 'IF' it will give you the syntax that Alteryx needs:
If [Field1] < 7.99 then '0-7 days'
elseif [Field1] <= 30 then '8-30 days'
elseif [Field1] <= 60 then '30-60 days'
elseif [Field1] <= 90 then '60-90 days'
elseif [Field1] <= 120 then '90-120 days'
elseif [Field1] <= 180 then '120-180 days'
else 'over 180 days'
endif
@Kinetic_analytics your formula is correct, just change IF to IIF
IIF([X2]<7.99,"0-7 days",IIF([X2]<=30,"8-30 days",IIF([X2]<=60,"30-60 days",IIF([X2]<=90,"60-90 days",IIF([X2]<=120,"90-120 days",IIF([X2]<=180,"120-180 days","over 180 days"))))))
I am getting Invalid type of operator 😞
Please provide sample data. Make sure the field with the number is saved as a numeric data type.
Thanks. It works. 🙂