Hi, I have a Survey123 Connect (v3.19) form that has a triple nested repeat. I need to sum() fields from the repeats, in the parent.
I can find information on how to do this with just one repeat. The sum fields I have created are not returning correct data. Can anyone explain to me how to sum across a triple nested repeat?
I have 3 nested repeats, Locations, Health Hazards and Personal Property. I did create a new field in the parent (outside of all the repeats). I want to sum a field from the Health Hazards repeat. Total_of_flammables is the field I created in the parent. Under Calculation field, sum(${flammables_count}) is how I wrote it. Do I need to call the repeat name as well? I can't find any exact instructions for creating a sum across triple nested repeats. Any help would be appreciated. Thank you.
Hello, I think I can help with this. I suspect you may need to add some `calculate` fields to your nested repeats to make the sums of each level available to higher levels of the survey. If you are able to share your XLS form with me, I am happy to experiment locally and see what I can do!
I do this in several forms.
You need to sum at each level of the repeats.
You have a parent, child, grandchild if triple nested. Add a sum() at the child level that sums up the grandchildren then add a sum at the parent level that sums up the child sum field. This will get them all.
Hope that helps
Hi Doug,
Ok, thank you for your direction for adding repeat sum() at child and grandchild levels. I will give it a try. Thank you very much!