Hide rows in matrix question dependent on embedded data | XM Community
Skip to main content

Hide rows in matrix question dependent on embedded data

  • September 29, 2022
  • 3 replies
  • 108 views

Forum|alt.badge.img

Hi all
I am conducting a data collection on interpersonal relations within work units. Each work unit has a different number of employees, and hence, if Person A from unit 1 has 10 colleagues in her unit, a question on for example "seeking information from your closest colleagues" should list these 10 people by name in separate rows in the matrix. On the other hand, if Person B from unit 2 has 7 colleagues in his unit, Person B should only see these 7 people's names. The names and unit numbers are loaded as embedded data, as well as the name of the colleagues (Kol_1, Kol_2, etc.) in separate columns. See the image below for an example.
Network, Q community.PNGI have managed to get it working IF I construct one block per work unit and list the correct number of colleagues (total number in each minus one, i.e., the respondent him or herself). However, I was wondering whether it is possible to use only one block for all the respondents independent of work unit affiliation?
When I try this, at this moment, Person B with only 7 colleagues are presented with these 7 names BUT also with three rows (without a name but with answer options) because the matrix is constructed with ${e://Field/Kol_1} all the way through ${e://Field/Kol_10}. I would like for these three rows to be automatically and dynamically omitted when the cells in the embedded data are empty (as they are because only 7 colleagues exist).
Honestly, I am in doubt what I need to do for the rows to be omitted. Maybe JavaScript? Any help is much appreciated!

3 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • September 29, 2022

You can use display logic on your statements. For example, display logic for the 10th statement:
If Embedded Data Kol_10 Is Not Empty


Forum|alt.badge.img
  • Author
  • September 30, 2022

Thank you Tom! Clearly I was knee-deep in a classic attempt to over-engineer my solution. Thank you for pointing out the obvious 😊


SuhasM
Qualtrics Employee
Forum|alt.badge.img+16
  • Qualtrics Employee
  • September 30, 2022

Thank you so much TomG for providing a simpler display logic based solution! And, thank you abgroen for confirming that it works! 🙂