Calculation do not return any value

1. What is the issue? Please be detailed.
Calculation do not return any value.

2. What steps can we take to reproduce this issue?
I have attached questionnaire ( in word format) and Xlsform for support

3. What have you tried to fix the issue?
I have tried many suggestions on this platform but none worked in my case.

4. Upload any test forms or screenshots below.
try4_repeat.xlsx (160.7 KB)
Tool.docx (13.9 KB)

1 Like
  1. You had a constraints column, and it should just be constraint. I added a constraint (and message) to make sure the number of people with health insurance is less than or equal to the total number of people in a household. I also added a constraint so that the number of people cannot be less than zero.

  2. You don't need to ask the user to manually input the household number if it is just the order number of the repeats. You can use a calculate type question with position(..) to get he current group number.

  3. Instead of asking the user to put a "1" for yes and "2" for no with an integer type question, you can use a select_one type question. Use '1' and '0' for the name value and use yes and no for the label value. However, you may not need to ask the user if all members are insured! You can use a calculate type question with if( ${num_people}-${num_insured}=0, '1','0') to get the same result from their other answers. If the calculation is okay, then you would delete the yes/no question.

  4. To get the sum of all the results of a question inside of a repeat group you can use only the sum(...) function and the reference to the question name. For example: sum(${num_people})

  5. For your percentage, it will show up something like "76.92307692307693" - if you want you can use the round() function to make it display better. For example: round( (${output2} div ${output1} *100),'1') to round to "76.9".

Please see the changes in: try4_repeat_edits.xlsx (161.1 KB)

1 Like

Thank you very much for this. I really appreciate. will try so now and give feedback.