- Posts: 159
- Thank you received: 0
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
- ledoux
- Offline
- Premium Member
Less
More
8 years 1 week ago - 8 years 1 week ago #134890
by ledoux
New user of LS but with the will to contribute to this great community !
Replied by ledoux on topic result of hidden question depending on previous list question answer
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!!
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.
- ledoux
- Offline
- Premium Member
Less
More
- Posts: 159
- Thank you received: 0
8 years 1 week ago #134891
by ledoux
New user of LS but with the will to contribute to this great community !
Replied by ledoux on topic result of hidden question depending on previous list question answer
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
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10113
- Thank you received: 3595
8 years 1 week ago - 8 years 1 week ago #134919
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic result of hidden question depending on previous list question answer
No.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?
Code:
{if(Q1_SQ1 != '' AND Q1_SQ1 == Q1_SQ2 AND Q1_SQ1 == Q1_SQ3 AND Q1_SQ1 == Q1_SQ4, 1, 0)}
I don't understand the question. I thought the requirement was to insert 1 into an equation question if all answers are the same.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...) ?
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.
- ledoux
- Offline
- Premium Member
Less
More
- Posts: 159
- Thank you received: 0
8 years 1 week ago #134930
by ledoux
New user of LS but with the will to contribute to this great community !
Replied by ledoux on topic result of hidden question depending on previous list question answer
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 !!!
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.
- ledoux
- Offline
- Premium Member
Less
More
- Posts: 159
- Thank you received: 0
7 years 11 months ago #135542
by ledoux
New user of LS but with the will to contribute to this great community !
Replied by ledoux on topic result of hidden question depending on previous list question answer
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 !!
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10113
- Thank you received: 3595
7 years 11 months ago #135553
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic result of hidden question depending on previous list question answer
That normally indicates that you have defined a variable incorrectly.LS reports the equation as a result for the variable
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- ledoux
- Offline
- Premium Member
Less
More
- Posts: 159
- Thank you received: 0
7 years 11 months ago #135598
by ledoux
New user of LS but with the will to contribute to this great community !
Replied by ledoux on topic result of hidden question depending on previous list question answer
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 !!
thank you !!
New user of LS but with the will to contribute to this great community !
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10113
- Thank you received: 3595
7 years 11 months ago #135605
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic result of hidden question depending on previous list question answer
Working survey attached!have you tested the code you proposed to me?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: Mazi, ledoux
The topic has been locked.
- ledoux
- Offline
- Premium Member
Less
More
- Posts: 159
- Thank you received: 0
7 years 11 months ago #135642
by ledoux
New user of LS but with the will to contribute to this great community !
Replied by ledoux on topic result of hidden question depending on previous list question answer
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,
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10113
- Thank you received: 3595
7 years 11 months ago #135660
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic result of hidden question depending on previous list question answer
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.
- ledoux
- Offline
- Premium Member
Less
More
- Posts: 159
- Thank you received: 0
7 years 11 months ago #137094
by ledoux
New user of LS but with the will to contribute to this great community !
Replied by ledoux on topic result of hidden question depending on previous list question answer
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 !
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.