- Posts: 57
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Set range condition for Other option & Multiple numerical input
- xueting
- Topic Author
- Offline
- Senior Member
Less
More
2 years 8 months ago - 2 years 8 months ago #219185
by xueting
Set range condition for Other option & Multiple numerical input was created by xueting
Hi all,
There are 2 questions about setting ranges for answers, I would appreciate if there will be any help. The lss. file is attached.
Firstly, I was wondering is it possible to set range for the other option of List (radio)? In the following question showed in the 1st picture, the other option is for one-day cost of car-parking, and I'd like to set the range such as 20.
The 2nd is in regard to the Multiple numerical input showed in the 2nd picture. I read a post about how to set different ranges for answers,
forums.limesurvey.org/forum/can-i-do-thi...nge-condition#179363
The thing is it didn't work in my case. The ranges I expect for the 1st answer (hour) is 4, for the 2nd (minute) is 59. Thus I entered the following into the question validatoin equation: (!is_empty(TripTimeWork_SQ001) AND !is_empty(TripTimeWork_SQ002) AND TripTimeWork_SQ001<4 AND TripTimeWork_SQ002<59)
Seems only Maximum value of input (59) works here. Now the max. limitation for both of them are 59.
Kind regards,
Xueting
There are 2 questions about setting ranges for answers, I would appreciate if there will be any help. The lss. file is attached.
Firstly, I was wondering is it possible to set range for the other option of List (radio)? In the following question showed in the 1st picture, the other option is for one-day cost of car-parking, and I'd like to set the range such as 20.
The 2nd is in regard to the Multiple numerical input showed in the 2nd picture. I read a post about how to set different ranges for answers,
forums.limesurvey.org/forum/can-i-do-thi...nge-condition#179363
The thing is it didn't work in my case. The ranges I expect for the 1st answer (hour) is 4, for the 2nd (minute) is 59. Thus I entered the following into the question validatoin equation: (!is_empty(TripTimeWork_SQ001) AND !is_empty(TripTimeWork_SQ002) AND TripTimeWork_SQ001<4 AND TripTimeWork_SQ002<59)
Seems only Maximum value of input (59) works here. Now the max. limitation for both of them are 59.
Kind regards,
Xueting
Last edit: 2 years 8 months ago by xueting.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12923
- Thank you received: 3977
2 years 7 months ago #219208
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Set range condition for Other option & Multiple numerical input
Hm, nearly correct.
Here your example back with some improvements.
You may fine tune the error messages.
Here your example back with some improvements.
You may fine tune the error messages.
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- xueting
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 0
2 years 7 months ago #219222
by xueting
Replied by xueting on topic Set range condition for Other option & Multiple numerical input
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12923
- Thank you received: 3977
2 years 7 months ago #219231
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Set range condition for Other option & Multiple numerical input
You just have to add the case that a normal item was selected, like this
(CarParkWork=='-oth-' AND CarParkWork_other < 20) or (CarParkWork!='-oth-')
Joffm
(CarParkWork=='-oth-' AND CarParkWork_other < 20) or (CarParkWork!='-oth-')
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- xueting
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 0
2 years 7 months ago #219233
by xueting
Replied by xueting on topic Set range condition for Other option & Multiple numerical input
Understand, thanks a lot!
Xueting
Xueting
The topic has been locked.
- xueting
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 0
2 years 7 months ago #219256
by xueting
Replied by xueting on topic Set range condition for Other option & Multiple numerical input
Hi Joffm, I was also wondering whether it's possible to establish logical relationships between ranges and answers? E.g. the range of trip time is dependent on the trip distance they would indicate.
Best regards,
Xueting
Best regards,
Xueting
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12923
- Thank you received: 3977
2 years 7 months ago #219258
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Set range condition for Other option & Multiple numerical input
Of course it is possible.
Without knowing more, I should say
Use an equation with a nested if statement to set the time range depending on distance.
Use the result of the equation to set the logic of the time question.
Joffm
Without knowing more, I should say
Use an equation with a nested if statement to set the time range depending on distance.
Use the result of the equation to set the logic of the time question.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- xueting
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 0
2 years 7 months ago - 2 years 7 months ago #219266
by xueting
Replied by xueting on topic Set range condition for Other option & Multiple numerical input
Last edit: 2 years 7 months ago by xueting.
The topic has been locked.
- xueting
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 0
2 years 7 months ago - 2 years 7 months ago #219474
by xueting
Replied by xueting on topic Set range condition for Other option & Multiple numerical input
Hi Joffm,
There is another question, whether it's possible to set ranges for boxes in table of Array(text)?
The lss.file is attached. As the following picture shows, column 1 and 4 are all the text field, I was wondering could they be set as numerical input and column 1 <100 while column 4<200?
Best regards,
Xueting
There is another question, whether it's possible to set ranges for boxes in table of Array(text)?
The lss.file is attached. As the following picture shows, column 1 and 4 are all the text field, I was wondering could they be set as numerical input and column 1 <100 while column 4<200?
Best regards,
Xueting
Last edit: 2 years 7 months ago by xueting.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12923
- Thank you received: 3977
2 years 7 months ago #219495
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Set range condition for Other option & Multiple numerical input
Hi,
you have to validate.
Here for the first row:
(is_empty(Q1_Y001_X001) or (is_numeric(Q1_Y001_X001) and Q1_Y001_X001 ge 0 and Q1_Y001_X001 lt 100)) and (is_empty(Q1_Y001_X004) or (is_numeric(Q1_Y001_X004) and Q1_Y001_X004 ge 0 and Q1_Y001_X004 lt 200))
and a hint like
{if(!is_empty(Q1_Y001_X001) and (!is_numeric(Q1_Y001_X001) or Q1_Y001_X001 ge 100),"Only numbers between 0 and 99 in column 1",if(!is_empty(Q1_Y001_X004) and (!is_numeric(Q1_Y001_X004) or Q1_Y001_X004 ge 200),"Only numbers between 0 and 199 in column 4",""))
You have to extend the validation for the other rows.
Joffm
you have to validate.
Here for the first row:
(is_empty(Q1_Y001_X001) or (is_numeric(Q1_Y001_X001) and Q1_Y001_X001 ge 0 and Q1_Y001_X001 lt 100)) and (is_empty(Q1_Y001_X004) or (is_numeric(Q1_Y001_X004) and Q1_Y001_X004 ge 0 and Q1_Y001_X004 lt 200))
and a hint like
{if(!is_empty(Q1_Y001_X001) and (!is_numeric(Q1_Y001_X001) or Q1_Y001_X001 ge 100),"Only numbers between 0 and 99 in column 1",if(!is_empty(Q1_Y001_X004) and (!is_numeric(Q1_Y001_X004) or Q1_Y001_X004 ge 200),"Only numbers between 0 and 199 in column 4",""))
You have to extend the validation for the other rows.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- xueting
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 0
2 years 7 months ago #219684
by xueting
Replied by xueting on topic Set range condition for Other option & Multiple numerical input
Thank you Joffm! It works well:)
Best regards,
Xueting
Best regards,
Xueting
The topic has been locked.
- xueting
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 57
- Thank you received: 0
2 years 7 months ago #220107
by xueting
Replied by xueting on topic Set range condition for Other option & Multiple numerical input
Hi Joffm,
I have another question. That is when there is more than one range condition for a question, then the red(!) without text would always there before all answers for blanks are entered, and the red(!) will turn to green (!) when the eligible answers are put in the blanks. It seems this mechanism of red(!) without text is a bit misleading. I was wondering can it disappear?
Many thanks,
Xueting
I have another question. That is when there is more than one range condition for a question, then the red(!) without text would always there before all answers for blanks are entered, and the red(!) will turn to green (!) when the eligible answers are put in the blanks. It seems this mechanism of red(!) without text is a bit misleading. I was wondering can it disappear?
Many thanks,
Xueting
The topic has been locked.