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
15 - Aurora
15 - Aurora

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?

 


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