Welcome to the LimeSurvey Community Forum

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

Show only selected answers from previous question

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #197530 by Joffm
Hi,

assuming your codes in Q1 are
SQ001 Desktop
SQ002 Laptop
SQ003 Tablet
SQ004 Smartphone
SQ005 Television set

set the subquestion relevances in Q2

Desktop Computer:: Q1_SQ001="Y"
Laptop : Q1_SQ002="Y"
Tablet - : Q1_SQ003="Y"
Tablet – Transfer videos into it and watch : Q1_SQ003="Y"
Smartphone - Online : Q1_SQ004="Y"
Smartphone – Transfer videos into it and watch: Q1_SQ004="Y"
Smartphone – Download videos and watch: Q1_SQ004="Y"
Television (Including Smart Television): Q1_SQ005="Y"

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 11 months ago #197539 by AmirahR247
Replied by AmirahR247 on topic Show only selected answers from previous question
Hi,

I added the sub question relevance as below but it doesn't seem to be taking the condition if i select only tablet all other options still appear.

i went to:
Q2 --> edit sub-questions --> relevance equation --> Q1_SQ002="Y"

Which would for example be tablet.

i am expecting tablet to then appear in Q2 if i selected in in Q1.

Please advise

thank you
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #197544 by holch
You need to use "==".

With Q1_SQ002="Y" you are assigning the value "Y" to Q1_SQ002 instead of checking if it is actually "Y".

So try to use Q1_SQ002=="Y", of course only if your first question has the question code "Q1" and if "SQ002" is the subquestion code you defined for tablet.

Because when I look at your first example, tablet is actually the 3rd subquestion in the first question. So you need to adapt the question codes and subquestion codes from Joffm's example to your codes uses in your survey.

But in any way, you need to use "==" instead of "=".

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
3 years 11 months ago #197550 by AmirahR247
Replied by AmirahR247 on topic Show only selected answers from previous question
Im not sure if im editing this incorrectly, but i have it as below, and still is not accepting.

/Code/sub-question/relevance equation.

/SQ002/Tablet /Q1_SQ002=="Y". (examples for edit format)

basically what im looking for is if i select SQ002 in Q1 only Q1_SQ002 for Q2 should appear.

i added the relevant equation as per the above instructions but still no luck.

I added an .LSS file im not sure if you are able to review my query from here, the relevant question index for the actual survey are S04(Q1) & S06(Q2)

Thank you
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #197556 by holch
Your posts are rather confusing. Hopefully the LSS file will clarify things.

But, first of all: you should always only export LSS files with only the relevant questions included, which in your case seem to be S04 and S06. So the correct procedure would be to copy the survey, delete all the unnecessary stuff and then export it. This makes it easier for us to quickly understand your survey and focus on the essentials, rather than to look around. Luckily you gave at least the questions that are relevant. Some people just send a huge survey and expect us to find the relevant questions within the whole thing.
Often it already helps to focus your survey on the essentials and you see the mistakes yourself, because you can test so much quicker.

I'll have a look at it and see if I can find something.

The first thing I did was deleting all unnecessary questions. When checking those things, I try to keep things simple and stupid, to get rid of all the clutter around the problem and make sure that the problem really is within these 2 questions, rather than a problem somewhere else that impacts these 2 questions.

I can confirm the problem and I did not find the problem yet. I deleted the Javascripts in S04 to make sure they are not the problem, but seems like the problem still persists.

I will continue checking things.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago - 3 years 11 months ago #197559 by holch
OK, got it.

The problem seemed to derive from the fact that you mixed the array filter (you had "S04" written in the array filter field in S06).

So array filter already does what you want to do. It filters the answer options in S06 based on the answers in S04 (as long as the subquestion codes are the same in both questions). I deleted your relevance equations in the subquestions in S06 and the array filter does its magic...

You should either use one or the other. In your case, as the answeroptions/subquestions in both questions are 100% the same, you should use array filter. It is a lot quicker. You just write S04 into the box and do not have to write a relevance equation for each answer option.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 3 years 11 months ago by holch.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #197560 by holch
Now, from what I have understood, you would like to have the first question (S04) with e.g. tablet only once, but then in the second question (S06) you would like to have both options, "Tablet - Online" and
"Tablet – Transfer videos into it and watch". I this case, you can not use the array filter, it only works if in both questions the answer options / subquestions are the same and have the same code.

So what you need to do is to delete the array filter first, and then use the relevance equations accordingly.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #197561 by holch
OK, here we go. I fixed your problem. Remember: don't mix "array filter" with "subquestion relevance".

I have my "solution" attached as an LSS file. As I said, for checking problems I prefer to have the problem isolated, just to make sure that anything isn't else outside of the two questions isn't causing the problem. So this file is just to show you, how it works. You'll have to fix your original file based on what I am showing.

There are two groups of questions:
The first one is like you presented the questions in your LSS: the same subquestions in both S04 and S06. In this case, just use only the array filter. simple and easy. works.

Now if you want to have only "tablet" in the first question and then show "tablet 1" and "tablet 2" in the second one, then the array filter doesn't help. Here the subquestion relevance comes in handy, because it is more flexible.

This is what I am showing in the second question group.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #197563 by Joffm
Okay, okay, the "=" instead of the "==" was my mistake. One typo, several times copied:
Sorry.


And there was another issue.

In S06 you set an exclusive option SQ010, which didn't exist.
Removed this, all was fine, and of course removing the array filter.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
3 years 11 months ago #197566 by AmirahR247
Replied by AmirahR247 on topic Show only selected answers from previous question
works perfect!

Thank you all kindly for the assistance, this is much appreciated.

have a good day.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose