Show family members that are 15+ in a multiple selection question

1. What is the issue? Please be detailed.
I have a repeat group of family members where i collect name, age, etc...

Following the end of the above repeat group, I have a multiple selections question m2_q3, where I want to list only the members who are 15+ of age . How can this be done?

Members_Testing.xlsx (10.0 KB)

You can add an expression in the choice_filter column to define a condition to keep choices. In order to be able to do that, you have to build the select on a repeat that includes the info you want to filter on. I think that means you'll want to use select_multiple ${m1_c0} so that you have access to the value of m1_g2.

You have an inner group so your expression will be something like m1_g0/g1_g2 >= 15. That expression will be evaluated against every repeat2 instance and only instances that have an age 15+ will be included.

Please note that if you're using a select multiple, you must ensure that the options to be selected have no spaces in them or else plan on doing your analysis manually. When multiple values are selected, they are separated by spaces.

Thank you for your reply!

However I tried using select_multiple ${m1_c0} as you suggested and I got an error that only says : error '${m1_c0}

I'm uploading an updated version of the form that can be tested.

Members_Testing.xlsx (163.8 KB)

I would really appreciate any help on this :slight_smile:

I was going quickly and forgot about some limitations of the implementation.

First, select_multiple is not supported. See the documentation.

Second, groups within the repeat aren't supported (pyxform issue on Github).

What comes next in your form? Could you instead ask a yes/no question about education for each person who is above 15 within repeat2? Could you even ask follow-up questions about people who have completed primary education directly in that repeat? If you say more about your workflow I can share more concrete alternatives.

Hi @Jad and @LN ; I have followed through and am re-attaching the xls. Look at it and see my explanation below;

I notice some few things in @Jad 's need;
I have made it a bit general so the you can drop m2_q3 which seems unnecessary. Also, the repeat3 I've added is only for showing a manual way to filter on household member names to only zero in upon a needed few;

But in my opinion you have to notice that the resulting data is not so simple to analyse - it requires good understanding of how the system is behaving.

  • I think You can accomplish all the things you need within the repeat2. use the indicated portion in attached xls

  • If repeat2 is sufficient, drop repeat3 and all hh_member variables. Otherwise, these will complicate your data. If okay, repeat3 will help you to filter the members as you add conditions to be satisfied by each member

Members_Testing.xlsx (172.5 KB)