Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Hiding a question when all answer rows are filtered out of view

Hiding a question when all answer rows are filtered out of view 1 Jahr 6 Monate her #90772

  • JoyLaneResearch
  • JoyLaneResearchs Avatar
Imagine two questions on separate pages (groups) in a survey:
Q05B - Which colors of widgets do you carry? [MULTIPLE RESPONSE QUESTION TYPE]
1 Red
2 Green
3 Blue
Q06B - How many of each do you have in stock? [MULTIPLE NUMERIC QUESTION TYPE]
1 Red _____
2 Green _____
3 Blue _____

I have an Array filter on Q06B set pointing to Q05B so that only rows answered in Q05B appear when Q06B is displayed. This filter is set correctly and works as expected.

At present, when I test the survey without choosing any of the responses in Q05B, the questions text for Q06B appears with no answer options. What would be the appropriate technique for setting a relevance equation for my Q06B so that it does not appear when none of the options are answered in Q05B?

I've tried summing, i.e., sum(Q05B_1.NAOK, Q05B_2.NAOK, Q05B_3.NAOK) > 0. I've also tried experimenting with !is.empty(Q05B_1.NAOK), etc., but I couldn't get it right. Any guidance would be appreciated!

Thank you!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Hiding a question when all answer rows are filtered out of view 1 Jahr 6 Monate her #90788

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6207
  • Dank erhalten: 788
  • Karma: 238
Hello,

try:
sum(Q05B_1.NAOK=="Y", Q05B_2.NAOK=="Y", Q05B_3.NAOK=="Y") > 0

If not:
(Q05B_1.NAOK=="Y" or Q05B_2.NAOK=="Y" or Q05B_3.NAOK=="Y")

Denis
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Hiding a question when all answer rows are filtered out of view 1 Jahr 6 Monate her #90813

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4058
  • Dank erhalten: 742
  • Karma: 341
You can still use the conditions designer to generate your relevance equations.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Hiding a question when all answer rows are filtered out of view 1 Jahr 6 Monate her #90847

  • JoyLaneResearch
  • JoyLaneResearchs Avatar
Denis

Your second suggestion worked perfectly!

A note to anyone seeking to implement it in their own survey: be careful of case. The first time I tried the solution, my relevance equation was in all caps, but my question lables had were in mixed case. Once I fixed that, the solution worked.

Thanks!
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.232 Sekunden
Donation Image