Please help us help you and fill where relevant:
Your LimeSurvey version: 2.62.2+170203
Own server or LimeSurvey hosting: Hosted by Uni Hamburg
Survey theme/template: Uni Hamburg Theme
==================
Hi, I am trying to use the expression manager to do an assessment in LimeSurvey, in two steps.
First, I create a new variable with an equation:
Code:
sum([url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ001.NAOK[/url], [url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ002.NAOK[/url], [url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ003.NAOK[/url], if(is_empty([url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ004[/url]), 0, 8 - [url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ004.NAOK[/url]), [url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ005.NAOK[/url]) / count([url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ001.NAOK[/url], [url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ002.NAOK[/url], [url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ003.NAOK[/url], [url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ004.NAOK[/url], [url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1160629]indopenminded_SQ005.NAOK[/url])
This produced the right result during the survey -- the individual questions are likert scale questions, so result is int or float (say 2, or 2,2)
Now At the end of the survey I want to do calculations with the thus created variables, e.g: simple things like
Code:
round([url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1161290]calcindopenminded.value[/url], 1)
.
This works as long as the variable contains an integer. If it is a float, I end up with NaN results -- and
Code:
is_numeric([url=https://www.limesurvey.uni-hamburg.de/index.php/admin/questions/sa/view/surveyid/788825/gid/94914/qid/1161290]calcindopenminded[/url])
is true only if the variable contains an int, and false if it is a float.
I'd very much appreciate help how to rectify this -- how can I make sure that the result of creating the variable above is a float variable, not a string?
Thank you very much in advance!