Welcome to the LimeSurvey Community Forum

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

Filter Single Choice Radio Answers

  • primesoftware
  • primesoftware's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #165371 by primesoftware
Filter Single Choice Radio Answers was created by primesoftware
I have a list radio question (Q1) with answers (A1-A9), and I would like to filter Q2's (also a list radio) answers based on the selection for Q1. For example, in Q2 I want to only show B2, B4, B8 if A1 is chosen in Q1. I've seen some previous posts on this, but they seem dated.

www.limesurvey.org/forum/can-i-do-this-w...single-choice-answer

Is this still the preferred way of doing this? I am running the latest version of LimeSurvey (3.5).
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago #165373 by Joffm
Replied by Joffm on topic Filter Single Choice Radio Answers
Please read this
www.limesurvey.org/forum/can-i-do-this-w...ion-and-array-filter

You can create a hidden multiple question, set the desired values by an equation and use this multiple question as array filter of the second single question

{MQ2_SQ002=if(Q1 == "A1", "Y", "")}
{MQ2_SQ004=if(Q1 == "A1", "Y", "")}
{MQ2_SQ008=if(Q1 == "A1", "Y", "")}

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • primesoftware
  • primesoftware's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago - 6 years 1 month ago #165374 by primesoftware
Replied by primesoftware on topic Filter Single Choice Radio Answers
Should those snippets go in the question validation equation field for Q1? Should the input value for array filter in Q2 be "MQ2"? Should the answer codes for Q2 be SQ001, SQ002, etc?
Last edit: 6 years 1 month ago by primesoftware.
The topic has been locked.
  • primesoftware
  • primesoftware's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #165377 by primesoftware
Replied by primesoftware on topic Filter Single Choice Radio Answers
I have spent all day trying to do exactly as described but its busted. Here is what I did to no avail....

Q1 (added {Q1M_SQ002=if(Q1 == "A1", "Y", "")}'s to question validation equation field)
Q1M (set as multiple choice hidden)
Q2 (added same fields with same codes as Q1M.....set array filter to Q1M)

Nada. I either get nothing displayed or everything displayed in everything I tried. I checked the logic on Q1M and it says there is an error in the questions validation. If I change it to not hidden that error goes away. I have also tried "Equation" type and still no good.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago #165384 by Joffm
Replied by Joffm on topic Filter Single Choice Radio Answers
Hi,
you have to enter this in a question of type "equation".
manual.limesurvey.org/Question_type_-_Equation
I did not talk about "validation".

Did you import the attached sample in the other thread?
You see the method and can adapt to your needs.
If you provide your entire logic I will see if I get time to work it out.
I attach the sample again

File Attachment:

File Name: limesurvey...3-14.lss
File Size:25 KB


Joffm

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago - 6 years 1 month ago #165407 by Joffm
Replied by Joffm on topic Filter Single Choice Radio Answers
Here is a working example.
In Q1 selectedShown in Q2
A12,4,8
A23,5
A31,7,9
A41,2,3,4
A55,8
A66,8,9
A74,5,6
A85,6,9
A91,9

Adapt it to your needs.

File Attachment:

File Name: limesurvey...3-14.lss
File Size:28 KB


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 6 years 1 month ago by Joffm.
The following user(s) said Thank You: primesoftware
The topic has been locked.
  • primesoftware
  • primesoftware's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #165429 by primesoftware
Replied by primesoftware on topic Filter Single Choice Radio Answers
Ok, I see how the structure works now! I realized though it only works when Q1 and Q2 are not shown on the same page at the same time. I can live with that. Thanks!!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose