Select to view content in your preferred language

# Survey123 if statement calculation

738
4
10-20-2023 07:33 AM
New Contributor III

Good Morning Community,

Again, I know this shouldn't be hard, but I can't get the calculation to work using an if statement. Could someone help with the name columns Two09 and Two09Calc. It currently has this for the calculation:

if(\${FinalFireAcreQuantity}>='300','Yes','No')

Also, I would like to add a condition for NumberFatalities >=1 to the if statement.

If statement is true, then Two09 = Yes, if not Two09 = No.

1 Solution

Accepted Solutions
MVP Regular Contributor

I think the issue might be that you are trying to use a comparison operator ( >= ) on a string ( '300' ). What is the field type of \${FinalFireAcreQuantity}? If it's a number type, try removing the quotes around 300 and see if that works.

Best,
Katie

“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
4 Replies
MVP Regular Contributor

I think the issue might be that you are trying to use a comparison operator ( >= ) on a string ( '300' ). What is the field type of \${FinalFireAcreQuantity}? If it's a number type, try removing the quotes around 300 and see if that works.

Best,
Katie

“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
New Contributor III

Goodness, that worked! Thanks for the response and have an excellent weekend!

Also, added more to the statement. if((\${FinalFireAcreQuantity}>=300 or \${NumberFatalities} >=1), 'Yes','No')

Christopher

New Contributor

on what type of column do you put the if statements?

MVP Regular Contributor

@PavlovaVitale In a case like this, it should go in the Calculate column

Best,
Katie

“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek