- Posts: 38
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Only Show Question if more than 2 options selected on the previous question
- zserban
- Topic Author
- Offline
- Junior Member
Less
More
6 years 2 months ago - 6 years 2 months ago #163437
by zserban
Only Show Question if more than 2 options selected on the previous question was created by zserban
Hello,
The scenario is this:
Q1. How often have you visit this places (multiple answers):
1
2
3
4
5
6
...
95. I don't visit.. (exclusive)
0. Others. Which? ...
Q2. Which place do you frequent more (single answer/radio question)?
(conditions: only show if selected 1,3,4,5../Array filter to only show options selected on Q1)
Now want I want to know is how to show Q2 only to people who have more than one response at Q1.
The scenario is this:
Q1. How often have you visit this places (multiple answers):
1
2
3
4
5
6
...
95. I don't visit.. (exclusive)
0. Others. Which? ...
Q2. Which place do you frequent more (single answer/radio question)?
(conditions: only show if selected 1,3,4,5../Array filter to only show options selected on Q1)
Now want I want to know is how to show Q2 only to people who have more than one response at Q1.
Last edit: 6 years 2 months ago by zserban.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
6 years 2 months ago #163438
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Only Show Question if more than 2 options selected on the previous question
Are you aware of relevance equations as an alternative to conditions.
manual.limesurvey.org/Expression_Manager
In your last sentence you articulated the following rule:
Display Q2 if Q1 has more than one answer item ticked.
On the Expression Manager manual page you will find some functions described.
One is count.
count the number of answered (non-blank)questions in the list number count(arg1, arg12, ..., argN)
In the relevance field of Q2 you could enter something like {count(q1.NAOK)>1}
The curly braces are not needed in the relevance fields.
manual.limesurvey.org/Expression_Manager
In your last sentence you articulated the following rule:
Display Q2 if Q1 has more than one answer item ticked.
On the Expression Manager manual page you will find some functions described.
One is count.
count the number of answered (non-blank)questions in the list number count(arg1, arg12, ..., argN)
In the relevance field of Q2 you could enter something like {count(q1.NAOK)>1}
The curly braces are not needed in the relevance fields.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- zserban
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 1
6 years 2 months ago - 6 years 2 months ago #163439
by zserban
Replied by zserban on topic Only Show Question if more than 2 options selected on the previous question
Thank you, jelo.
So, here is what I did, noob mode on
When to question 2/edit and copy the conditions I added with the set conditions interface in a text file.
Then, I removed them from set conditions. I went back to edit questions, put in the stuff from the text file, and after the first closing parenthesis I added "and count(that.A001.NAOK)>1"
So, here is what I did, noob mode on
When to question 2/edit and copy the conditions I added with the set conditions interface in a text file.
Then, I removed them from set conditions. I went back to edit questions, put in the stuff from the text file, and after the first closing parenthesis I added "and count(that.A001.NAOK)>1"
Last edit: 6 years 2 months ago by zserban.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
6 years 2 months ago #163440
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Only Show Question if more than 2 options selected on the previous question
After reading your last post I unsure if you succeed or if you're still looking for a solution.
If you're still looking for a solution, please state what version of LimeSurvey you use and attach a surveyexport here.
I would have removed the conditions and than use the display / hide logic via relevance.
See attached screenshot (LS 3.X, but older versions of LimeSurvey provide these field too).
If you're still looking for a solution, please state what version of LimeSurvey you use and attach a surveyexport here.
I would have removed the conditions and than use the display / hide logic via relevance.
See attached screenshot (LS 3.X, but older versions of LimeSurvey provide these field too).
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Attachments:
The topic has been locked.
- zserban
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 1
6 years 2 months ago #163443
by zserban
Replied by zserban on topic Only Show Question if more than 2 options selected on the previous question
Hi again.
I am on version 2.7.
In this version, at least, you cannot edit that field if you used Set conditions to set expressions.
So, I had to remove the conditions I added through the set conditions first, only then it let me edit that field.
what worked was to add the following condition to the existing ones "and count(that.QID.NAOK)>1" when u put "that" it adds all the answers in the question, and their count has to be higher than 1.
I am on version 2.7.
In this version, at least, you cannot edit that field if you used Set conditions to set expressions.
So, I had to remove the conditions I added through the set conditions first, only then it let me edit that field.
what worked was to add the following condition to the existing ones "and count(that.QID.NAOK)>1" when u put "that" it adds all the answers in the question, and their count has to be higher than 1.
The topic has been locked.
- zserban
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 1
6 years 2 months ago - 6 years 2 months ago #163445
by zserban
Replied by zserban on topic Only Show Question if more than 2 options selected on the previous question
Jelo, I am wondering about another thing.
I have another question I would like to show if the response from a previous question does not equal to something, but also not equals to a response from another previous question. If i use something like ((212858X90X3017.NAOK != "A8") and ((... != "..."))) the second condition is skipped. How do you manage such a case?
I have another question I would like to show if the response from a previous question does not equal to something, but also not equals to a response from another previous question. If i use something like ((212858X90X3017.NAOK != "A8") and ((... != "..."))) the second condition is skipped. How do you manage such a case?
Last edit: 6 years 2 months ago by zserban.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
6 years 2 months ago #163446
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Only Show Question if more than 2 options selected on the previous question
Use relevance instead of conditions to be more flexible. You cannot edit relevance when using conditions. That is the same in every LS version.
First read the expression manager manual.
If you use conditions you might need to add different scenarios.
First read the expression manager manual.
If you use conditions you might need to add different scenarios.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- zserban
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 1
6 years 2 months ago #163448
by zserban
Replied by zserban on topic Only Show Question if more than 2 options selected on the previous question
Alright, thank you for the inputs!
The topic has been locked.