Welcome to the LimeSurvey Community Forum

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

Multiple numerical input: Slider - no movement = "NAN"?

  • ALehner
  • ALehner's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago - 6 years 10 months ago #155302 by ALehner
Hi there,

I have a question regarding the slider function for the question type "Multiple numerical input":

In our survey we want to use the slider with min value: 1 and max value: 9;

--> We use the stated numbers for the next question as we calculate a mean and show it to the participant in table.

The problem is that if the participant does not move the slider at least once, we cannot do calculations because no number was stated and we get "NAN" in the table.

There is the possibility to set a "Slider initial value" but still, if the participant does not move the slider no number will be recognized and "NAN" will be stated. The setting of an initial value has an influence on the site where the slider is shown but does not influence a possible value that can be used later for calculations.

Is there a possibility within Limesurvey to do a workaround or is there a function that could solve that problem?
(Using the Online Version)


If the description of the problem was to vague plz do not hesitate to call back.

Thanks in advance!
Last edit: 6 years 10 months ago by ALehner.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 10 months ago #155305 by tpartner
Can you provide the code that you are using to calculate the mean?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ALehner
  • ALehner's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago #155322 by ALehner
Sure (normalization):

{round(1/sum(1, 1/Q02_SQ001, 1/Q02_SQ002, 1/Q02_SQ003)*100,2)} %

Thanks in advance!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 10 months ago #155334 by tpartner
This is a bug. If you set a "Slider initial value", that value should act the same as a default value, so should be recorded in the data and seen by Expression Manager.

bugs.limesurvey.org/view.php?id=12445

In your case, since no initial value is seen, the expression is trying to calculate a sum where three values are infinite so fails to NAN.

As a workaround, try setting "Default answers" as well as "Slider initial value".


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: ALehner
The topic has been locked.
  • ALehner
  • ALehner's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 10 months ago #155337 by ALehner
Great! That works!

Thank you!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose