Pulling eligible respondents from the roster

Hi,
I’m creating a Caregiver survey that collects Household characteristics and is a repeat group.
hd101. Name of the member in the household:
hd102. Relationship to household head: (1-Head, 2-Spouse, 3-Child more than 5 yrs, 4-Child less than 5 yrs)
hd103. Sex:
hd104. Age:
Later, in another group, I would like to retrieve only the children whose relationship is 3 in hd102 and more than 12 years in hd104 and less than 18 years in hd104. Is it possible to use multiple criteria using indexed-repeat?

Have you gone through our post discussed previously (it should solve your issue):

This one should also be helpful:

1 Like

Thank you Kal for sharing the resources. My question is - suppose there are two children who are less than 5 years in the family. Will I be able to retrieve both of them for the later part of the group of questions?

1 Like

Yes. It should pull all the eligible members form the household roster.

Thank you so much for the prompt support.

2 Likes

I received an error. It says XPath evaluation: type mismatch and it also says 'You may need to use the indexed-repeat() function to specify which value you want.

Maybe the community should be able to help you out if you share the same with the community.

Hi @fsimon23
Even as you share your form as indicated by @Kal_Lam , I would recommend that you first edit using the following logic.

  1. You are pulling everyone under the age of 5 from a repeat group. In essence, you would need to ensure that you can count the number who meet the criteria.
  2. Add a question, (e.g. U5Check) within the repeat group that checks whether the member is aged below 5 and give a response as either 1 (yes) and 0 (no) using if(${age}>5,1,0)
  3. Outside the group, add a calculate question that gets the total number of children as sum(${U5Check})

TO LIST

  1. Now you need to list all the children. I recommend creating text questions that can be equal to the number of households members (all)
  2. Create a relevant condition that the name from each instance of the previous repeat questions, if the instance for that repeat had the U5Check meeting the yes criteria. You will need to use indexed repeat which had been shared in a much earlier post.

Try incorporating th9is logic and then share your form

Stephane

1 Like