Indexed-repeat, third dynamic argument

What is the problem? Please be detailed.

Hi everyone! The problem is that i can't use the indexed-repeat function correctly.
I have a survey that asks me how many households I'm going to survey. If i type, for example, three households, the survey will asks me how many persons are in each home.
Let's suppose i wrote one for the first home, three for the second one and five for the last.

Well, starting from here, the problem is:
When i have the number of the households defined and the persons living there, the survey starts. I have some modules, that repeats for every home / every person. I need to know, in every module, which home and which person of that home i'm polling. I know i need to use indexed-repeat function, but i don't know how to pass the third parameter dynamically. Maybe my explanation is hard to understand, my english is not so good. Whatever, I leave the files below. I'd really appreciate ur help

What ODK tool and version are you using? And on what device and operating system version?

ODK Collect v1.12.2

What steps can we take to reproduce the problem?
U will see in my files, the row that asks the number of households, and then the row that ask the number of persons in the home (inside a repeat group based on the number of the households). Here begins the first module of the survey, and the first two rows are those repeats that must show the house number and the number of the person surveyed. Each module must be repeated for each person in the first home, then for each person in the second, and finally for each person in the last home. But returns an indexed-repeat error (I suppose because i have two repeats group, one inside another, and i don't know how to apply the indexed-repeat function with the third dynamic parameter, for identify each member of each home)

What you have you tried to fix the problem?

I tryied to "configure" the indexed-repeat function, doing a count-calculation and some more, but i can't do this dynamically... And isn't enough for me, for example, to do ten or twenty rows for the persons of each home... that's not useful haha

Anything else we should know or have? If you have a test form or screenshots or logs, attach here.

I leave the example file, thanks!
survey.xlsx (12.7 KB)

I solved this using the position() function like third argument. But now, i want to write only one row for show the respondent's name in every module, not one row for each one... any ideas?