I’m struggling with a synthax issue.
I’ve a roster of household members. For each member, we ask his main activities, in a multi-select question called indiv_activ
Then, after the roster, we ask the respondent to pick-up the most important activity for the entire household, within a list restricted to those choice that have been choosen previously for individuals.
Therefore this single-select question has a filter:
mh_roster.Any(x=>x.indiv_activ.Contains(@optioncode)) // (hh_roster is the roster of members, and indiv_activ is the individual question about the main activities).
And is enabled only if there is at least an option (enabling condition: mh_roster.Any(x=>x.indiv_activ!=null)
Now, we want to ask about the second most important activity, at household level. This is where is becomes more tricky. I want to add a enabling condition, to avoid asking the question to a household, where, say, everybody would have the same activity (i.e. in the case there is no second most important activity, by construction).
The idea is to be able to count the number of different answer to the question indiv_activ, for all members of the household (all rows in the roster). So far, I’ve not managed to do this.
I’ve try an enabling condition like this:
mh_roster.SelectMany(x=>x.indiv_activ).Count() >=2 // this is not working
Someone ever encontered any similar issue? How would you fix this?
Thanks a lot!
EDIT: correction of the description of indiv_activ