We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

IF statement with AND condition

janety0127
7 - Meteor

Hi,

I need 2 conditions to be true before the formula can run. But its not working for me. Its acting as if its an "OR" statement. See example:

 

IF [A]<0 AND [B]>0

THEN 0
ELSE [A]/ [B]
ENDIF

 

I need both [A] to be less than 0 and [B] to be greater than 0 for the formula to return 0. As of now, when I run the model it wil return 0 if [A] is less than 0 OR [B] is greater than 0 What am I doing wrong?

2 REPLIES 2
TheOC
16 - Nebula
16 - Nebula

hi @janety0127 

This appears to work fine on my end - I would be careful with your formula though, as you are allowing for division by 0, which will result in null!

TheOC_0-1603240325685.png

 

Are you able to attach a workflow showing what you mean?

 

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
RobertOdera
13 - Pulsar

Hi, @janety0127 

 

1. Kindly check your field Type to make sure it's not Byte

2. Your formula looks good. Kindly check for Typo or maybe you inadvertently have an <= versus < OR >= versus > in your argument

 

Cheers!

Labels
Top Solution Authors