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
8 years 1 week ago - 8 years 1 week ago #134890 by ledoux
Tpartner, thank you !
In your exemple, "Q1" is the question's code, that's it?

Suppose I have 4 items (rows), then it will be
{if(Q1_SQ1 != ' ' AND Q1_SQ1 == Q1_SQ2 == Q1_SQ3 == Q1_SQ4, 1, 0)}

that's it?

If I don't want to introduce the condition "answer must be filled", then I take off (Q1_SQ1!=' ') that's it?
thank you!!

New user of LS but with the will to contribute to this great community !
Last edit: 8 years 1 week ago by ledoux.
The topic has been locked.
More
8 years 1 week ago #134891 by ledoux
Tpartner
complentary : let's suppose I have 4 items in the table. Then if the respondent forget to check one radio button but answers the same "column" (scale answer) for all the other items. Then I would like to attribute value 1 to the hidden test-variable.
do you know how it this feasible (seems complicate to code...) ?
Thank you

New user of LS but with the will to contribute to this great community !
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 week ago - 8 years 1 week ago #134919 by tpartner

Suppose I have 4 items (rows), then it will be
{if(Q1_SQ1 != ' ' AND Q1_SQ1 == Q1_SQ2 == Q1_SQ3 == Q1_SQ4, 1, 0)}

that's it?

No.
Code:
{if(Q1_SQ1 != '' AND Q1_SQ1 == Q1_SQ2 AND Q1_SQ1 == Q1_SQ3 AND Q1_SQ1 == Q1_SQ4, 1, 0)}


complentary : let's suppose I have 4 items in the table. Then if the respondent forget to check one radio button but answers the same "column" (scale answer) for all the other items. Then I would like to attribute value 1 to the hidden test-variable.
do you know how it this feasible (seems complicate to code...) ?

I don't understand the question. I thought the requirement was to insert 1 into an equation question if all answers are the same.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 1 week ago by tpartner.
The following user(s) said Thank You: ledoux
The topic has been locked.
More
8 years 1 week 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
7 years 11 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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 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
7 years 11 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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 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 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
7 years 11 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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 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
7 years 11 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.

Lime-years ahead

Online-surveys for every purse and purpose