- Posts: 5070
- Thank you received: 1263
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Save a multiplication in the results. Only 0 or NAN is saved.
- jelo
- Topic Author
- Offline
- Platinum Member
Less
More
8 years 7 months ago #123447
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Save a multiplication in the results. Only 0 or NAN is saved. was created by jelo
Think of multiple choice question with three answers.
Then a equation question with this content:
When you check all three answers the result of the equation is (1*5)+(1*10)+(1*15)=30.
This is displayed correctly but Limesurvey saves NAN in the results.
This behavior might be as intended.But how to save the result of such calculation inside the results?
LS Version 2.06+ Build 150731and Version 2.05+ Build 150508 both show the same behavior.
Then a equation question with this content:
Code:
sum(((check_SQ001.NAOK == "Y") * 5) + ((check_SQ002.NAOK == "Y") * 10) + ((check_SQ003.NAOK == "Y") * 15))
When you check all three answers the result of the equation is (1*5)+(1*10)+(1*15)=30.
This is displayed correctly but Limesurvey saves NAN in the results.
This behavior might be as intended.But how to save the result of such calculation inside the results?
LS Version 2.06+ Build 150731and Version 2.05+ Build 150508 both show the same behavior.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- jelo
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
8 years 7 months ago #123453
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 Save a multiplication in the results. Only 0 or NAN is saved.
Just a demo survey with checkbox and radiobutton question. Values from the single choice question are saved, when using multiplechoice items 0 or NAN are saved in the results. Perhaps I'm too dumb and too blind.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
8 years 7 months ago #123454
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 Save a multiplication in the results. Only 0 or NAN is saved.
It may be because check_SQ001.NAOK == "Y" returns true or false, not a number. Try using equation questions to define those variables.
Something like this in the equation:
Something like this in the equation:
Code:
if (check_SQ001.NAOK == "Y", 1, 0)
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jelo
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
8 years 7 months ago - 8 years 7 months ago #123455
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 Save a multiplication in the results. Only 0 or NAN is saved.
Thanks for your time.
When you run the survey the values are all calculated fine. It is the saving in the results which won't work.
I have tried different things over 4 hours to find where I made a mistake. But every workaround (e.g. using count or if ) I could think of didn't changed the missing value in the results.
And Limesurvey itself is creating this relevance equation from the condition "checkbox 1 is ticked":
((check_1.NAOK == "Y"))
What a riddle.
When you run the survey the values are all calculated fine. It is the saving in the results which won't work.
I have tried different things over 4 hours to find where I made a mistake. But every workaround (e.g. using count or if ) I could think of didn't changed the missing value in the results.
And Limesurvey itself is creating this relevance equation from the condition "checkbox 1 is ticked":
((check_1.NAOK == "Y"))
What a riddle.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Last edit: 8 years 7 months ago by jelo.
The topic has been locked.
- jelo
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
8 years 7 months ago #123460
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 Save a multiplication in the results. Only 0 or NAN is saved.
Mhm. Tony. I tried it once again with the IF. This time it worked. I still wonder, why the value is shown correctly, but not saved. Thanks again for motivating me to try it once again with the IF concept.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
8 years 7 months ago - 8 years 7 months ago #123466
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 Save a multiplication in the results. Only 0 or NAN is saved.
That might be worthy of a bug report.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 7 months ago by tpartner.
The topic has been locked.