I am trying to use the calculate feature in survey123 connect to generate a score by adding up all the fields.

787
5
Jump to solution
09-20-2023 01:45 PM
LynneWarwick
New Contributor II

I am trying to use the calculate feature in survey123 connect to generate a score by adding up all the fields. I have ran into an issue adding up more that 6 fields. I have the responses set as yes=1 and no=0, the survey will add up the first 6 fields, if add more fields to the equation, stops adding the responses and just displays the responses rather than adding them together. Any thoughts or suggestions?

0 Kudos
1 Solution

Accepted Solutions
Katie_Clark
MVP Regular Contributor

If you're doing a mathematical calculation, have all the fields been correctly set as number types?

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

5 Replies
Katie_Clark
MVP Regular Contributor

If you're doing a mathematical calculation, have all the fields been correctly set as number types?

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
LynneWarwick
New Contributor II

which fields do I need to make sure they are set as number types?

0 Kudos
Katie_Clark
MVP Regular Contributor

well, if you're trying to add numbers together, they would all have to be number types.

i.e. if you want 1 + 1 = 2, those are number types. If 1 + 1 = 11, that's text. 

Here's a screenshot from the Survey123 documentation showing the syntax to use in your calculation to make sure they are all number types.

Katherine_Clark_0-1695244284586.png

 

If you still have questions, sharing some screenshots of your XLS form might be helpful!

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
LynneWarwick
New Contributor II

Thank you! the cell where the calculation is, needed to be set (formatted) as a number. 

0 Kudos
DougBrowning
MVP Esteemed Contributor

Set the bind::type column to int and that should fix it.

0 Kudos