Welcome to the LimeSurvey Community Forum

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

result of hidden question depending on previous list question answer

More
9 years 4 months ago #134930 by ledoux
thank you Tpartner
1) what is the importance of writing (Q1_SQ1 != '') ? Do I have to write this for all the SQs?
2) Seconde point : yes you are right. But With this equation, if I don't answer to 1 of the questions, and even if I answer the same thing to all the OTHER questions, then the equation value is "0". So how can I manage this case? that is : set value "1" to the equation if the person answer the same to all the question and EVEN IF he doesn"t answer to 1 or 2 questions. (because my questions are not mandatory, so answering is optional)
Thank you very much !!!

New user of LS but with the will to contribute to this great community !
The topic has been locked.
More
9 years 3 months ago #135542 by ledoux
T partner !
I've tried your proposal : {if(Q1_SQ1 != '' AND Q1_SQ1 == Q1_SQ2 AND Q1_SQ1 == Q1_SQ3 AND Q1_SQ1 == Q1_SQ4, 1, 0)}
It is not working: in the result export, instead of "0" or "1", LS reports the equation as a result for the variable...

My proposition with {if(Q1_SQ1 != ' ' AND Q1_SQ1 == Q1_SQ2 == Q1_SQ3 == Q1_SQ4, 1, 0)} seems working I think.. need to test it more to me sure.

What did I do wrong with your proposal according to you?
Thank you !!

New user of LS but with the will to contribute to this great community !
The topic has been locked.
More
9 years 3 months ago #135553 by tpartner

LS reports the equation as a result for the variable

That normally indicates that you have defined a variable incorrectly.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 3 months ago #135598 by ledoux
Tpartner, I have checked the code several times to respect your model. And I have 6 variables of that kind, all with this kind of result. I guess it is hardly a problem of bad writing, what do you think ? have you tested the code you proposed to me? I don't really know what to do...
thank you !!

New user of LS but with the will to contribute to this great community !
The topic has been locked.
More
9 years 3 months ago #135605 by tpartner

have you tested the code you proposed to me?

Working survey attached!

File Attachment:

File Name: limesurvey...32-2.lss
File Size:16.27 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Mazi, ledoux
The topic has been locked.
More
9 years 3 months ago #135642 by ledoux
Tpartner
Thank you. I think I forgot the {..}. I will see if it works (survey already activated).
If the hidden "equation question" is set at the next page, is that a problem ? You put them in the same page. I thought the system needed a "submit" to generate the "SQ" and values, etc.
best,

New user of LS but with the will to contribute to this great community !
The topic has been locked.
More
9 years 3 months ago #135660 by tpartner
Expression Manager is dynamic on a page (mostly).

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: ledoux
The topic has been locked.
More
9 years 2 months ago #137094 by ledoux
Dear Tpartner
It is strange because in the file "result export" I can find "0", "1" and the equation in extenso.

What is wrong according to you?

by the way, the equation is
if(L1croyABfermeesPos_SQABPOS1 != ' ' AND L1croyABfermeesPos_SQABPOS1 == L1croyABfermeesPos_SQABPOS2 AND L1croyABfermeesPos_SQABPOS1 == L1croyABfermeesPos_SQABPOS2 AND L1croyABfermeesPos_SQABPOS1 == L1croyABfermeesPos_SQABPOS3 AND ... , 1, 0)

thank you !

New user of LS but with the will to contribute to this great community !
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose