Hello, Trying to deploy my survey form, I faced some error messages when using the calculation question type. It seems that the question type in my form crashed with something. I tried to figure out what the problems are by searching keywords on the Kobo community. But I still have been struggling with the issue. Why couldn’t it demonstrate the advanced calculate function such as if statements or sum when others work well?
I also made some slight edits in the calculation column like IF to if and SUM to coalesce(${C3},0) + coalesce(${C4},0) + coalesce(${C5},0) as outlined in the image below:
Hello @jessiemj,
Your problem was if and sum need to be in small letter. KoBo is mostly casesensitiv. functions, expression syntax etc. only in small letters. Of course, you are free for Capitals in names and labels, but names need to be unique independent of capitals.
My goodness, how fast!
Your solution works so well. Thanks for your helping.
I want to say all my problem has gone now, but I encountered another obstacle.
What I plan for my form is showing the score of the household hunger scale.
Previewing the sample, I realized that I missed counting the score 0 when the respondent answered No to hunger.
So I put other calculation question types so that it can include all scores without missing 0 points.
But then the error report popped up as below:
Besides, just one tiny question, is there any reason that you used the coalesce function rather than using sum? I have no idea that kind of function exists at all. I read the manual pages (https://support.kobotoolbox.org/advanced_calculate.html) but couldn’t find such a command.
Is there any page that demonstrates the advanced command like coalesce? If you let me know where it is, it would be helpful. Thanks for your devotion.