Select to view content in your preferred language

Survey123 if statement calculation

1839
4
Jump to solution
10-20-2023 07:33 AM
ChristopherMask
Regular Contributor

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 Alum

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

If this answer helped you, please consider giving a kudos and/or marking as the accepted solution. Thanks!

View solution in original post

4 Replies
Katie_Clark
MVP Alum

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

If this answer helped you, please consider giving a kudos and/or marking as the accepted solution. Thanks!
ChristopherMask
Regular Contributor

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
Emerging Contributor

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

 

0 Kudos
Katie_Clark
MVP Alum

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

Best,
Katie

If this answer helped you, please consider giving a kudos and/or marking as the accepted solution. Thanks!
0 Kudos