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
  • zserban's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 1 month ago - 6 years 1 month ago #163437 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.
Last edit: 6 years 1 month ago by zserban.
The topic has been locked.
More
6 years 1 month ago #163438 by jelo
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.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • zserban
  • zserban's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 1 month ago - 6 years 1 month ago #163439 by zserban
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"
Last edit: 6 years 1 month ago by zserban.
The topic has been locked.
More
6 years 1 month ago #163440 by jelo
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).

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • zserban
  • zserban's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 1 month ago #163443 by zserban
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.
The topic has been locked.
  • zserban
  • zserban's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 1 month ago - 6 years 1 month ago #163445 by zserban
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?
Last edit: 6 years 1 month ago by zserban.
The topic has been locked.
More
6 years 1 month ago #163446 by jelo
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.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • zserban
  • zserban's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 1 month ago #163448 by zserban
Alright, thank you for the inputs!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose