Trouble Using indexed-repeat() Function with Nested Repeat Group

1. What is the issue? Please be detailed.

Can I get values from one repeat group iteration and use it in another? How would I accomplish this?

I collect data at different times (12, 24, 48, 72, 96, 144, 168). The main repeat group is 'Timepoint,' and inside it, there's a repeat group called 'Compartment' that repeats ten times for each timepoint.

I'm counting the live and dead mosquitoes in each compartment at every time point. I need to make sure that the number of mosquitoes at time point 24 doesn't exceed what we counted at time point 12, for each of the ten compartments. Same to the rest of the timepoints.

The amount of live and dead mosquitoes should not be more than what was counted at previous time point, as per the study's design.

Please keep in mind Compartment repeat group (1-10) is nested inside the Timepoint repeat group (12, 24, 48, 72, 96, 144, 168)

How can I retrieve the counts of live and dead mosquitoes at previous time point and compare them with the counts at current time point for the corresponding compartments?

2. What steps can we take to reproduce this issue?
See the screenshoots

3. What have you tried to fix the issue?

I attempted to use indexed-repeat() as described in the ODK documentation (https://docs.getodk.org/form-operators-functions/#repeat-groups). However, it doesn't function properly when the repeated group containing the question is nested within the main repeated group.

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


Repeat_group_text.xlsx (17.9 KB)
Review attached xlsx file.

Hello @Derick_Deo,

Thanks a lot for this! It works well, and I'm grateful for the time you spent on it.

1 Like