Relevant question in repeated group

Hi,

I'm having a problem with a specific Relevant Question within a repeated group.
Here is an example of my problem.

Q1) How many people live in your household ?
Q2) Did the person 1 get zika last year
Q3) Did the person 1consult a doctor ? the relevant field here is ${zika}=yes

Nothing difficult, but in the second repeated group, I always get an error (you might need indexed repeat here type) I understand the issue here but i don't know how to resolve this...

Q2) Did the person 2 get zika last year
Q3) Did the person 2 consult a doctor ? the relevant field here is ${zika}=yes, and i understand i have to change that but i don't know how to do.

Can you help me,

Thanks

I've provide an example which may address this. I haven't tested it though.

You place the "How many people live in your household ?" outside of the repeat group, and then have a repeat group cycle through for the number of people in the HH.

Alternatively, you can just collect HH roster, and include your Q2 and Q3 in the roster Qs.

An example of the first option is attached (modified from @yanokwa's example HERE

repeat_count.xlsx (11.3 KB)

Hi Lloyd,

Thanks a lot for your example and the time you dedicated to answer me.
I think your proposition isn't working, i already tried it. i can't join the example because i am a new member

I think we have to developed a bit more the relevant field ${Q2}=1. I f you have three peoples in the HH, it will always refers to the answer from the person 1 and this is the probleme.

I dont the the formule to create a relevant field, saying ${Q2}=1FOR THE PERSON 1
${Q2}=1 FOR THE PERSON 2
${Q2}=1 FOR THE PERSON 3

I would be easier with the example ... I hope you understand me

Thanks a lot,

ST

Have you tested this on your device? If the relevant reference is from within the repeat group, it will refer to the current group, not the first group.

I was able to test this quickly and it appears to work as expected on my device.

Thanks Lloyd,

I used a different app and it wasn't working, with ODK Collect, it's working perfectly.

Thanks again,

ST

1 Like