In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

IF THEN Statement

AgiGovind
6 - Meteoroid

Hello - 

 

I'm trying to write the following formula in Alteryx; wondering if anyone could help:

 

if [difference] <=1 and [difference] >=-1 then "round off"

else " " endif

 

So any value between -1 to +1 should be commented as 'Round off' except 'zero' it should be blank.  

 

Output:

DifferenceComment
-0.36Round off
-0.25Round off
0 
0 
0.45Round off
3 REPLIES 3
A1exW
6 - Meteoroid

IF [Difference] = 0 then ""
elseif [Difference]<=1 and [Difference] >=-1 THEN "round off"
ELSE "" ENDIF

nagakavyasri
12 - Quasar

if [difference] <=1 and [difference] >=-1 and [difference]!=0 then "round off" else " " endif

apathetichell
20 - Arcturus

tbh --- you're pretty close here --- probably good practice for you to just add another formula tool and force convert 0 from round off to '' 

 

I'd use --> if abs([difference])>0 and abs([difference])<=1 then "round off" else "" endif

Labels
Top Solution Authors