Regarding the repeat count in the nested repeat group

1. What is the issue? Please be detailed.
In ODK, I have two groups, A and B, where B is nested within A. Group A has a repeat count of 20, and Group B has a dynamic repeat count. In Group B, there is a question called "collection_name," which tracks the sum of "yes" responses to the question "collection."

In a hypothetical scenario, during repeat count 1 of Group A, there are 5 instances of Group B, with 3 "yes" responses and 2 "no" responses to the "collection" question. When filling out repeat count 1 of group B in repeat count 2 of Group A, the value displayed for "collection_name" should be 3 by default, reflecting the number of "yes" responses in the previous repeat count.

4. Upload any forms or screenshots you can share publicly below.

You may add:

  • an integer variable inside the repeat, calculation with if(selected(..), 1, 0)
  • a calculate type variable with sum() function for this counting variable, after the repeat
  • an integer read-only variable (with a calculation) or a note (with a ${} reference, showing the current sum value.

Thanks @wroos. Is it possible to give me an xlsx format? I tried couple of things, but values were not correct.
Thanks in advance

Hi @SANATH

Please try this and let us know if it solves your problem:
sumCalc.xlsx (7.3 KB)