Page 1 of 1
Out of Range !
Posted: December 10th, 2022, 12:25 am
by VirtuesArios
Hello CSPro users, just like to share if anybody had the same problems that I have, it has a combo box
every time the users choose 20, 25, 40 and 50 it has an "Out of Range Error"
Code: Select all
5.11 Male child care (Feeds the children)
(Did not do activity) 0.00
15 minutes 0.25
20 minutes 0.33 x
25 minutes 0.41 x
30 minutes 0.50
35 minutes 0.58
40 minutes 0.66 x
45 minutes 0.75
50 minutes 0.83 x
55 minutes 0.91
0.92 60.99
Re: Out of Range !
Posted: December 10th, 2022, 5:20 pm
by sherrell
I'm not quite clear what you're doing. Could you post your application, or at least explain what the dictionary valueset looks like and what logic, if any, you have associated with this variable? thnx
Re: Out of Range !
Posted: December 11th, 2022, 10:06 pm
by VirtuesArios
Thanks sherrell for replying as attach to this thread the dictionary and the valueset image, what I was trying to do is just convert minutes to seconds or (e.g. 15/60 = 0.25) for statistical purposes) so that the Field Interviewer would choose the said answer of the respondent, as you can see in the dictionary in the value label is in minutes and in from it is already converted but if I choose 20, 25, 40 and 50 minutes it will give out an "Out of Range" but only on this said value/answer and no logic or whatsoever on this variable.
CSPro Dictionary.jpg
CSPro ValueSet.jpg
Re: Out of Range !
Posted: December 12th, 2022, 10:35 am
by aaronw
I was able to reproduce the issue and will need to look into it further. My suggestion is to store the values as whole numbers and then take an additional step to convert them to their decimal value.
Re: Out of Range !
Posted: December 12th, 2022, 10:50 pm
by VirtuesArios
aaronw wrote: December 12th, 2022, 10:35 am
I was able to reproduce the issue and will need to look into it further. My suggestion is to store the values as whole numbers and then take an additional step to convert them to their decimal value.
Thank you aaronw for the suggestion and taking up on this matter.
Re: Out of Range !
Posted: December 14th, 2022, 1:18 am
by VirtuesArios
aaronw wrote: December 12th, 2022, 10:35 am
I was able to reproduce the issue and will need to look into it further. My suggestion is to store the values as whole numbers and then take an additional step to convert them to their decimal value.
Hi aaronw or anyone in the forum that could give me an idea on how do I get the value if the user choose an answer (e.g. 15 minutes)
Re: Out of Range !
Posted: December 14th, 2022, 3:27 pm
by aaronw
I could imagine a couple different approaches that each require an additional post-data collection step.
Idea 1: Remove the decimal from the value sets, and add it back later.
(Did not do activity) | 0.00
15 minutes | 25
20 minutes | 33
25 minutes | 33
Then the additional post-data collection step is to multiple the value by 0.01.
Ideal 2: Store the time as minutes, and map it to the decimal value later.
(Did not do activity) | 0
15 minutes | 15
20 minutes | 20
25 minutes | 25
Then use an if else statement to map the values.
numeric mapped_value;
if E11A = 0 then
mapped_value = 0.0;
elseif E11A = 15 then
mapped_value = 0.25;
elseif E11A = 20 then
mapped_value = 0.33
// etc
else
mapped_value = 0.92
endif;
Re: Out of Range !
Posted: December 15th, 2022, 9:32 pm
by VirtuesArios
@aaronw, Thank you very much your such a great help
Cheers