Select to view content in your preferred language

Calculation not working

265
2
02-29-2024 10:40 AM
alyssajhnsn
New Contributor III

Still looking for the assistance of people smarter than I with this survey. 🙂

I got most of the calculations working, but there's one that just won't work. (I'm sure it's for a dumb reason). When selected, it does not calculate a value like it's supposed to. The bind is set to integer.

 

alyssajhnsn_0-1709231671705.png

In Survey123, the value shows as 0 when the option for crimeobserved is selected.

alyssajhnsn_1-1709231793071.png

The XLSForm is attached.

 

 

0 Kudos
2 Replies
dolson_farmington
New Contributor III

I think it is because you have CrimeObserved named differently in your "choices" sheet. There, it is just listed as "crime", so in your calculation, you'd have to write: if(selected(${crime},'crime'),1, 0)

 

OR change the name in the choices sheet to 'crime observed'

TylerGraham2
Occasional Contributor

Definitely this. 'crimeobserved' isn't a choice in the list, so it will always return 0.  

0 Kudos