Multiple if calculation

297
2
Jump to solution
07-26-2022 11:39 AM
Hammers211
New Contributor III

I have a survey that consists of 7 Yes/No/NA select_one questions. I would like to write a calculation that will evaluate those 7 questions, and if any of them are answered with a "Yes," a note is displayed with the text "Fail."

Here is what I have for my note calculation:

 if(${Prohibited_List} = "Yes", 'Fail', 'Pass') or if(${Drug_Ingredients} = "Yes", 'Fail', 'Pass')

It does not return an error, but it does not function as I would like. I realize I will need to include all 7 questions, but first I'd like to get it working with just these first two.

Thank you!

1 Solution

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @Hammers211

You can consolidate the condition into one if() statement, for example if(${Prohibited_List} = "Yes" or ${Drug_Ingredients} = "Yes", 'Fail', 'Pass'). 

Thank you,
Zach

View solution in original post

2 Replies
ZacharySutherby
Esri Regular Contributor

Hello @Hammers211

You can consolidate the condition into one if() statement, for example if(${Prohibited_List} = "Yes" or ${Drug_Ingredients} = "Yes", 'Fail', 'Pass'). 

Thank you,
Zach
DougBrowning
MVP Esteemed Contributor

When you use or no need for two ifs

if(${Prohibited_List} = "Yes" or ${Drug_Ingredients} = "Yes", 'Fail', 'Pass')