Select the multiple elements from multiple rosters based on the same criteria

Hi all,

I have two rosters derived from a multi-select question with “Others” as an option. One roster (called A) is derived from the selected options other than “Others”, the other roster (B) is derived from the list question that specify “Others”. In my case, the MCQ is “What infrastructure does your village have?” In the two rosters mentioned above, I asked the number of households each infrastructure serves (variable a1 in A and variable b1 in B). I want to choose the three infrastructures that serve the most households to ask for more details (in a new roster). How can I make it? Specifically, how can I select the three infrastructures from two rosters (A and B)? Can I merge these two rosters (A and B) into one? Since they share the same questions and the only difference is the type of their source questions.

Thank you!

In Survey Solutions you can:

  1. ask questions some times and skip them at other times. For programming this you use enabling conditions.
  2. indicate errors (warnings) for some answers and accept them without errors for other values. For regulating this you use validation conditions.
  3. show some options in categorical questions, but not the other depending on the answers to earlier questions. You use filtering conditions for that.
  4. calculate some values based on other values already in the questionnaire. You use calculated variables for that.

There is no command for ‘select’, ‘chose’ , ‘merge’ or other things that you’ve mentioned in your message. Instead you will need to turn your task into the expressions which could be either of the four types above.

PS: there are also filtering expressions on the level of interviews operating on ‘exposed variables’ that select whole interviews, but that is very far removed from the questions you are raising here.

Hi Sergiy,

Thank you very much for your explanation. Fully understand. Let me rephrase my question: How can I get the second largest value from the answers to a question in two rosters? In my example, in both rosters A and B, I asked the same question (say, the amount invested), the variable name of the question is a1 in A and b1 in B. How can I get the second largest value in both A and B? That is, put the answers to a1 in A and those to b1 in B together, sort them in descending order, what is the second value? I tried ElementAt and Union, but failed (no compile error, but the result is just null […]). Can you suggest a way of doing this? Thank you very much!

Unfortunately you haven’t shown the expression that you wrote. So it’s hard to imagine what was the issue there.

Still, you seem to be on the right track , as the functions you’ve mentioned would also be my choice for this solution. I’d mention OrderByDescending() in addition to Union() and ElementAt().


Is this for the Nigeria Feed The Future survey (FTF)?

Hope this helps.

Best, Sergiy

Thank you, Sergiy, for your reply! This is exactly what I wrote for this calculated variable. It was my fault to leave an associated question unanswered when testing. That is why I got the null. Thank you for your confirmation. It helped me figure out the problem correctly. Thank you!

Glad to help.
Would love to hear more about your survey, as such usage is not common.

Yes, Sergiy. You are right. This is not that common, maybe because it combines analysis with data collection in some sense. It is reasonable, though. For example, an MCQ contains an option “Other (specify)” followed by a list question to specify other answers. Then a roster is triggered by the MCQ except the “Other (specify)”, and another roster by the list question. These two rosters contain the same questions. Based on the answers to some question(s) in these two, more questions are asked in a third roster. That is what I met in my case: I want to pick the three infrastructure that serve the most households to ask more information.

Thanks to your confirmation, I figured it out. Thanks again for your help!