Dear support team.
We've been trying to the get attributes from roster elements (hhroster) that are selected in a multiple select question linked to that roster. To be more espefic:
- We have a roster of household members
- In a second roster (bank accounts roster), we ask to multiple select those household members who are account holders (this var is named accnme)
-From that multiple select, we want to know how many are women (memsex is asked in hhroster)
Following the example of burgers in a public questionnaire, we have been trying the following without success:
We appreciate your support in advanced
.Count() is applicable to a roster, not to an individual question.
As I understand you want to ask:
“AMONG THE HOUSEHOLD MEMBERS, HOW MANY ARE WOMEN AND SELECTED IN ACCNME?”
hhroster.Count(p=>p.sex==2 && accnme.Contains(p.@rowcode))
or a variation of that depending how the accnme is linked to the list or to a question in the roster.
Best, Sergiy Radyakin
I have created an illustration of my method in the section “Disability” of the “Public example User questions and common patterns”. It does correctly display the number of males, females, and children that have a disability, which is being an account holder in your example. If your questionnaire asks account ownership per account (thank you for the clarification) then the MCQ on ownership and variable for tallying the members should also be part of the roster on accounts.
The second question “how many women are account holders (of any of the accounts)” is then more difficult than the first one (which is separate by account) since one can’t simply add up the numbers due to possibility of duplication. Applying the same strategy, you calculate the status for every member, whether (s)he is an account holder, just like I calculate status isPetOwner in another example “Pets ownership” of the same questionnaire. Please study this example.
I have added a subsection of different tallies based on the household members dimension and pets dimension. The key idea is to try to work with the roster containing the items which you want to count, and treat every item as having or not having an attribute that is of interest to you. That you include in the definition of some calculated variable of the corresponding data level.
Best, Sergiy Radyakin
Dear Andres, Martina,
have you had a chance of checking the “Disability” and “Pet ownership” examples? Is any of the techniques used in them suitable for your case?
This question has received the maximum number of answers.