- Posts: 409
- Thank you received: 34
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
- Topic Author
- Offline
- Platinum Member
Less
More
6 years 2 months ago #163316
by blocka
Equation question to populate Yes/No question for Quota was created 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)
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)
Attachments:
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
6 years 2 months ago #163323
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Equation question to populate Yes/No question for Quota
Y and N instead of YES and NO.
Code:
{ForMyQuota=if((Q2 > 0) && (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
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
6 years 2 months ago #163327
by blocka
Replied by blocka on topic Equation question to populate Yes/No question for Quota
Something so simple! Thank you!
The topic has been locked.
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
6 years 2 months ago - 6 years 2 months ago #163330
by blocka
Replied by blocka on topic Equation question to populate Yes/No question for Quota
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!
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.