Select to view content in your preferred language

Survey123 if statement calculation

738
4
Jump to solution
10-20-2023 07:33 AM
ChristopherMask
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.

0 Kudos
1 Solution

Accepted Solutions
Katie_Clark
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

View solution in original post

4 Replies
Katie_Clark
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
ChristopherMask
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

PavlovaVitale
New Contributor

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

 

0 Kudos
Katie_Clark
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
0 Kudos