Sum and indexed-repeat within nested repeats

Dear all,

i am trying to master indexed-repeat in nested repeat groups but get stucked with a form with a similar structure as this example:

sumfromnestedrepeat.xlsx (571.0 KB)

The aim is to calculate the sum of ${count} field in the child repeat group from within the first repeat group (${sumcountwithinrepeat} in the example). This works without problems from outside the repeat group (${sumcountoutsiderepeat} in the example).

The problem is somehow related to the path. But if I understand indexed-repeat correctly it only allows to reference a value at a very specific position within the repeat. This contradicts with the aim to calculate the sum of the values in the ${count} fields of all repeat instances.

Any idea how to see clear on this issue?

Thanks very much for any help.

Best, Daniel

Hey @dast ! :waving_hand:

I'd suggest giving this a try:
sumfromnestedrepeat.xlsx (570.9 KB)

Let me know how it goes. Have a great day! :smile:

Thank you so much @MinimalPotato ! This works perfectly and brought me a step further in understanding how paths work.

1 Like