Nested repeat questions

1. What is the issue? Please be detailed.

Trying to develop a form that captures information about gradual land accumulation, for example:

Person A has 1 parcel of land, that they initially acquired by inheritance. But, they bought out the parcel next to them later to increase the area and rented additional area later. The top repeat asks the total area of the parcel in local units and calculates in terms of hectares. Then it asks all tenure status(es) of that parcel as well as the way in which the land was acquired.

Then, in a second repeat which loops for each way they acquired land, it asks the year it was acquired, some calculations to allow Thai folks to enter Buddhist years), how many owners it was acquired from, the prior use, and the purchase or rental price depending on how that sub-parcel was acquired.

then, after the inside repeat closes, it continues to ask for information about the current land use and some other things that I cut out of the sample form below for simplicity.

Current problems:

If I select that they inherited, purchased, and rented additional land, it asks for the purchase and rental price for all acquisitions, when I would like it to only ask for the relevant acquisitions (eg only ask purchase price for the second loop in the repeat, rental price for the third loop).

I think I will need to use the indexed-repeat function in some regard to accomplish this but not exactly sure how to set it up correctly as every time I've tried it ends up removing the calculated choice names or throws all sorts of errors. In its current form, it also throws errors in ODKcollect/Kobo but in Enketo it seems to work ok.

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

Try the attached form in Enketo or ODKcollect.

3. What have you tried to fix the issue?

Have looked at various forum posts on the subject (eg: here) and tried those solutions but none of them ended up working for what I need it to do.

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

area_calc_test (11).xlsx (19.8 KB)

Any advice much appreciated!