Filter Single Choice Radio Answers

More
7 months 3 days ago #165371 by primesoftware
primesoftware created the topic: Filter Single Choice Radio Answers
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).

Please Log in or Create an account to join the conversation.

More
7 months 3 days ago #165373 by Joffm
Joffm replied the topic: Filter Single Choice Radio Answers
Please read this
https://www.limesurvey.org/forum/can-i-do-this-with-limesurvey/113983-array-filter-exclusion-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

Please Log in or Create an account to join the conversation.

More
7 months 3 days ago - 7 months 3 days ago #165374 by primesoftware
primesoftware replied the 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: 7 months 3 days ago by primesoftware.

Please Log in or Create an account to join the conversation.

More
7 months 3 days ago #165377 by primesoftware
primesoftware replied the 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.

Please Log in or Create an account to join the conversation.

More
7 months 2 days ago #165384 by Joffm
Joffm replied the topic: Filter Single Choice Radio Answers
Hi,
you have to enter this in a question of type "equation".
https://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
Attachments:

Please Log in or Create an account to join the conversation.

More
7 months 2 days ago - 7 months 2 days ago #165407 by Joffm
Joffm replied the 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
Attachments:
Last Edit: 7 months 2 days ago by Joffm.
The following user(s) said Thank You: primesoftware

Please Log in or Create an account to join the conversation.

More
7 months 2 days ago #165429 by primesoftware
primesoftware replied the 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!!

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!