Welcome to the LimeSurvey Community Forum

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

Equation question to populate Yes/No question for Quota

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 years 2 months ago #163316 by blocka
I have two questions that I need to evaluate and based on that evaluation, I'm using an Equation type question to assign the result to a Yes/No question type so that I can use the Yes/No question in a Quota to early terminate a survey.

I have everything setup correctly, in that I can confirm in the Response table that the Yes/No question is being populated correctly.... But...

The Quota doesn't work though -- it is set up to check the Yes/No question, but when the response is "No", which should trigger the Quota, instead the participant isn't early-terminated.

I've attached the LSA of my survey so you can see it in action... I imagine it must be something quite simple, I just can't see it myself!

I'm using LS build #171219 (2.73)
The topic has been locked.
More
6 years 2 months ago #163323 by jelo
Y and N instead of YES and NO.
Code:
{ForMyQuota=if((Q2 > 0) &amp;&amp; (Q4_q4 <= 3 || Q4_q5 <= 3 || Q4_q6 <= 3), "Y", "N")}

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 years 2 months ago #163327 by blocka
Something so simple! Thank you!
The topic has been locked.
  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
6 years 2 months ago - 6 years 2 months ago #163330 by blocka
Okay, so an elaboration on this... If Q2=0, we want to hide Q4.

With my current Equation on question code "SetQuota", if I set a Relevance Equation of (Q2>0) on Q4, the Quota is triggered...

But the participant never saw Q4 -- I'm stumped how to write the Equation to avoid the Quota being triggered if Q4 isn't shown. Any suggestions?

I thought maybe:

{ForMyQuota= if(Q2=0,"Y",if((Q2 > 0) && (Q4_q4 <= 3 || Q4_q5 <= 3 || Q4_q6 <= 3), "Y", "N"))}

But that doesn't seem to work...

Editted: Ahhh. Better to use proper syntax (double = signs for comparison):

{ForMyQuota=if((Q2==0),"Y",if((Q2 > 0) && (Q4_q4 <= 3 || Q4_q5 <= 3 || Q4_q6 <= 3), "Y", "N"))}

That works!
Last edit: 6 years 2 months ago by blocka.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose