# In my form I would like to know the marital status of each child whose age is between 13 and 17 years in a household

Good evening community,
I have a problem with my form.
The form works in principle.
In my form I would like to know the marital status of each child whose age is between 13 and 17 years in a household.
To do this I have created a loop where I ask Kobo to take the age of each child within this range and their gender and then ask the following question: what is their marital status.
But when I downloaded the data I noticed that Kobo if there are 3 children in that age range creates the loop and allows to fill in the status. But looking at the data there is an error in importing the ages in the loop and the gender. Instead of seeing a 13 years old female person for example who is single, I find myself with a 0 years old female person and single for example.
I checked the coding and I still have the same problem.
Can someone help me with this the form is attached.
Best regards
formulaire_test.xlsx (15.3 KB)

Hi @Karimzak
The range 7-17 contains 6-14, so the numbers will increase
the repeat group â€śenf_statut_loopâ€ť will give a wrong result because the logic is incorrect
You need the index numbers for individuals aged 13-17, not all individuals

1 Like

I understand the error now. I tried to correct it but I canâ€™t. Please how to correct the error to have the correct age and gender.

Hi @MohammedTaleb
If you have time you can correct me or show me how.
Thanks

Hi @Karimzak
The attached file contains an example that will help you solve your issue
Please execute the file and check the results
indTest.xlsx (11.6 KB)

1 Like
1 Like

Hi @MohammedTaleb
Thanks for the help.
I have a small problem. If I test the kobo solution I canâ€™t set the age between 13 year and 17 year.
If I put three people whose ages are: 10, 15 and 17, it brings me back even the 10 year old when I just want 17 and 15 year.

I think Iâ€™ve found the solution.
I will test it if it works I will share.
Best regard

1 Like

Hi @MohammedTaleb
Sorry to bother you again with these questions
I come back again with several loops this time.
Indeed in my questionnaire I would like to make loops with specific ages.
I wanted to do with the example you gave me but I see that it does not work.
Attached are the loops I would like to make.

Do you have an idea of how to do it?
Best regard
test_finale.xlsx (137.9 KB)