Hi everyone,
I’ve created a household member list question (DEM_NAME
) and linked a roster to this list. This roster contains all the demographic questions. I also created a variable (textr_YOU_NAME
) to hold the index of the respondent. The goal is to use the pronoun “YOU” if the interviewer is referring to the respondent themselves.
For example:
What is %textr_YOU_NAME%’s relationship to %DEM_HEAD_NAME%?
The idea is:
- If the roster entry corresponds to the respondent, the question should use the pronoun YOU.
- Otherwise, it should use the person’s name from the list.
Here is the syntax used in the variable:
total_members == 1 ? “YOU” :
total_members >= 2 && @rowcode == DEM_RSP_PPNO ? “YOU” :
total_members >= 2 && @rowcode != DEM_RSP_PPNO ? DEM_NAME[@rowcode - 1].Item2 : null
The problem I’m facing:
When a person is deleted from the roster — especially the last one — the DEM_NAME
list updates automatically, and the index no longer points to the correct individual. This causes incorrect names or references in the questions.
Any suggestions on how to handle this issue or a better approach to maintain the correct reference would be greatly appreciated!