Welcome to the LimeSurvey Community Forum

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

Marking array answers based on previous array

  • vadikcoma
  • vadikcoma's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 4 months ago #161138 by vadikcoma
Hello, first of all - thanks for the awesome and free software!


We have a following survey - opros.comadev.noc.lv/index.php/836943?lang=lv - there are 2 arrays and questions are about radio-station audience.

First question - How often do you listen to this station
Second question - How do you listen to this station

My task is to make options from second array being marked as NOT LISTENING in case there answer I DONT KNOW THIS STATION in first array.

In my mind there should be this logic:

if array_1 question_1 answer = A6 then
array_2 question_1 answer A4 = "yes"
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 4 months ago #161143 by tpartner
Replied by tpartner on topic Marking array answers based on previous array
Why not place relevance on the sub-questions in Q2 so they don't show at all if the corresponding row in Q1 is "A6"?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • vadikcoma
  • vadikcoma's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 4 months ago #161144 by vadikcoma
Replied by vadikcoma on topic Marking array answers based on previous array
Could you please advise me how to do it? I’m totally new to this
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 4 months ago - 6 years 4 months ago #161149 by tpartner
Replied by tpartner on topic Marking array answers based on previous array
When editing the sub-questions you can place relevance on them to hide/show them based on answers to previous questions.

So, for example, if your first question has a code "Q1" and sub-question codes "SQ001, SQ002...", the relevance for the Q2 sub-questions would look something like this.

It basically says only show this row if the corresponding row in Q1 is answered and is not "A6".



Check out Expression Manager in the manual for more info - manual.limesurvey.org/Expression_Manager

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 4 months ago by tpartner.
The following user(s) said Thank You: vadikcoma
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 4 months ago #161150 by tpartner
Replied by tpartner on topic Marking array answers based on previous array
Here is a sample survey that also has relevance on Q2 to only show it if there are some answers in Q1 and not all Q1 answers are "A6".

Code:
count(that.Q1) > 0 AND count(that.Q1) != sum(Q1_SQ001=='A6', Q1_SQ002=='A6', Q1_SQ003=='A6', Q1_SQ004=='A6')

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • vadikcoma
  • vadikcoma's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 4 months ago #161297 by vadikcoma
Replied by vadikcoma on topic Marking array answers based on previous array
It did worked out! Thank you so much!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose