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

OR statement in a formula

tpostlewate
7 - Meteor

Good afternoon and happy new year! Let's get this party started!
I am trying to figure out how to use an OR statement in a formula.  This is my goal:

If [field 1] OR [field 2] =Y move Y to a new column, otherwise leave blank.

 

Thanks,
Terri

5 REPLIES 5
pedrodrfaria
13 - Pulsar

The formula you are looking for should be this:

 

If [field 1] = "Y" OR [field 2] ="Y" then "Y" else "" endif

pedrodrfaria_0-1609797135019.png

 

 

Pedro.

AngelosPachis
16 - Nebula

Hi @tpostlewate ,

 

In alteryx you have to use an equal sign to each component of the OR statement in a formula tool.

 

AngelosPachis_0-1609797066088.png

 

Hope that helps.

 

Regards,

 

Angelos

jrgo
14 - Magnetar
IF [Field1] = 'Y' OR [Field2] = 'Y' THEN 'Y' ELSE '' ENDIF
tpostlewate
7 - Meteor

This is my formula:

If [BehaviorBank: Donates to environmental causes] = Y OR [BehaviorBank: Contributes to charities] = Y then "Y" else "" endif

But I get a parse error at char (53): Unknown variable "Y" (Expression #1)

pedrodrfaria
13 - Pulsar

Make sure to put the Y inside of quotes if the field is a string value. If is numeric, do not put it inside of quotes.

Labels
Top Solution Authors