Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Only include answer in Matrix question if a certain answer was chosen

  • picknicker
  • picknicker's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago - 4 years 5 months ago #190323 by picknicker
Hi guys,

I apologize in advance if this question has been asked. I tried to look but could not find it.

I am designing a questionaire and in a matrix-question I want certain answer options only to pop up if a specific answer was given in a previous matrix-question.

I have been able to programm the matrix-qeustion so that the option pops up if the previous matrix-question was answered generally, but I only want it to pop up if a specific answer was chosen.

Let me illustrate:

Previous question:

How cool are cats? very cool cool not so cool


I want an answer-option in the following matrix-question to pop up only if "very cool" or "cool" was chosen, but not if "not so cool" was chosen.

So far I have this: "(( ! is_empty(118367X4X102SQ020)))" but, as mentioned, this lets the answer option in the following matrix-question pop up regardless of which option was chosen.

Can anyone help me out?

Rudi
Last edit: 4 years 5 months ago by picknicker.
The topic has been locked.
More
4 years 5 months ago #190329 by orvil
Hi picknicker,
could you please provide your LS version?

Generally: this is a common problem that was reported and discussed several times, but is still unresolved (also in the upcoming version 4).

Fortunately there are some javascript solutions and a plugin from DenisChenu as far as I know (but this depends on the LS version you are using).

Simplest way for you is to use the js plugin if yout LS version fits, if not I am using a js-script I will post if plugin does not fit.

Best regards/Beste Grüße,
O. Villani
The following user(s) said Thank You: picknicker
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190330 by tpartner
You can use sub-question relevance but we cannot give an example without knowing the question/sub-question codes.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: picknicker
The topic has been locked.
  • picknicker
  • picknicker's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago #190333 by picknicker
Thanks guys,

I am using Version 2.73.1

The question codes for the Previous questions are: question code - D3; subquestion code - SQ002; answeroptioncodes - A2 and A3
The topic has been locked.
More
4 years 5 months ago #190334 by jelo

orvil wrote: Generally: this is a common problem that was reported and discussed several times, but is still unresolved (also in the upcoming version 4)

Main bugreport ID?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
4 years 5 months ago - 4 years 5 months ago #190335 by orvil
Found it: you will find the solution from Denis here:
extensions.sondages.pro/questions-updati...ing/hideemptycolumn/

But I don't know if its working with 2.73

Best regards/Beste Grüße,
O. Villani
Last edit: 4 years 5 months ago by orvil.
The following user(s) said Thank You: picknicker
The topic has been locked.
More
4 years 5 months ago #190336 by orvil

Best regards/Beste Grüße,
O. Villani
The topic has been locked.
More
4 years 5 months ago #190338 by jelo

orvil wrote: Long, long ago:

Thanks for the link.
But it isn't a long time span for the LimeSurvey project ;-)

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190341 by tpartner
picknicker, are you trying to hide/show columns or rows of the array?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: picknicker
The topic has been locked.
  • picknicker
  • picknicker's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago #190342 by picknicker
I am trying to hide rows
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190344 by holch
For rows you should be able to use the subquestion relevance box without a problem.

Please provide a LSS file with only the two questions that are relevant, so we can give you an example that works.

D3; subquestion code - SQ002; answeroptioncodes - A2 and A3


To hide a subquestion (NOT Answer option!!) in the following question you can use something like this:
Code:
D3_SQ002=="A2" OR D3_SQ002=="A3"

If you would use 1,2 and 3 as answer options instead of the standard A1, A2, A3 it would be even easier:
Code:
D3_SQ002>1

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: picknicker
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago - 4 years 5 months ago #190346 by Joffm
So you want to get this


It's sufficient to set the relevance equation of the second question to the "good" condition:



You see that I used the codes "1", "2", ... instead of "A1, "A2",...
This way you could write "Q1_SQ001<3"; or if the 1st question is mandatory "Q1_SQ001!=3".

Joffm

P.S. You confused the people by saying "answer options", but thinking of subquestions.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 5 months ago by Joffm.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose