Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask 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