Welcome to the LimeSurvey Community Forum

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

Relevance equation for -oth-

  • Matadeleo
  • Matadeleo's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 7 months ago - 6 years 7 months ago #157854 by Matadeleo
Relevance equation for -oth- was created by Matadeleo
Hi, my set up is like this:

Q1. How many dogs do you have?

1. None
2. 1
3. 2
4. 3
5. 4
-oth- : More than 4: Please specify

Now, I'm following this with a multiple short text question to collect the breed for each dog

So I have a bunch of subquestions labelled, Dog 1, Dog 2 etc, and am showing them based on the option selected at Q1.

Label - (Relevance Equation)

Dog 1 - (1)
Dog 2 - ((Q1.NAOK == "3" OR Q1.NAOK == "4" OR Q1.NAOK == "5" OR Q1.NAOK == "-oth-"))
Dog 3 - ((Q1.NAOK == "4" OR Q1.NAOK == "5" OR Q1.NAOK == "-oth-"))
Dog 4 - ((Q1.NAOK == "5" OR Q1.NAOK == "-oth-"))
Dog 5 - ((Q1.NAOK == "-oth-"))
Dog 6 - ((Q1.NAOK == "-oth-"))
etc

You can see at the end there, even if the person entered "5" at Q1, they will see 6+ boxes to answer. Ideally I would like to be able to "target" the -oth- answer, which is numeric-only.

Something like:

Dog 5 - ((Q1_-oth- == "5"))
Dog 6 - ((Q1_-oth- == "6"))


Here is the example survey:

File Attachment:

File Name: testrelequat.lss
File Size:21 KB
Last edit: 6 years 7 months ago by Matadeleo.
The topic has been locked.
More
6 years 7 months ago #157856 by jelo
Replied by jelo on topic Relevance equation for -oth-
How to accessing the other field is depending on the questiontype. Often it is the best to attach the exported question here.

The value of the field is often accessible via Q1_other.shown .

You might assign the answer of the question to a new variable via a equation question, which you can use for relevance.
Code:
{if(Q1.NAOK=='-oth',Q1_other.shown,Q1.shown)}

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: Matadeleo
The topic has been locked.
  • Matadeleo
  • Matadeleo's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 7 months ago - 6 years 7 months ago #157857 by Matadeleo
Replied by Matadeleo on topic Relevance equation for -oth-
Hi Jelo, I have attached the file to my original post now.

Thank you for the solution, this was exactly what I needed.

No need for an equation question, you can simply enter - ((Q1_other.shown >= "5")) - into the relevance equation on the subquestions
Last edit: 6 years 7 months ago by Matadeleo.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose