- Posts: 6
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Filter Single Choice Radio Answers
- primesoftware
- Topic Author
- Offline
- New Member
Less
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).
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12904
- Thank you received: 3968
6 years 1 month ago #165373
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12904
- Thank you received: 3968
6 years 1 month ago #165384
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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
Joffm
Joffm
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
Joffm
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12904
- Thank you received: 3968
6 years 1 month ago - 6 years 1 month ago #165407
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Filter Single Choice Radio Answers
Here is a working example.
Adapt it to your needs.
Joffm
In Q1 selected | Shown in Q2 |
---|---|
A1 | 2,4,8 |
A2 | 3,5 |
A3 | 1,7,9 |
A4 | 1,2,3,4 |
A5 | 5,8 |
A6 | 6,8,9 |
A7 | 4,5,6 |
A8 | 5,6,9 |
A9 | 1,9 |
Adapt it to your needs.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 6 years 1 month ago by Joffm.
The following user(s) said Thank You: primesoftware
The topic has been locked.
- primesoftware
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
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.