- Posts: 8
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Numerical Value Validation for Multiple Choice Question
- HalloHans
- Topic Author
- Offline
- New Member
Less
More
5 years 4 months ago #177418
by HalloHans
Numerical Value Validation for Multiple Choice Question was created by HalloHans
Hi,
I am new to the forum and have a question, any help is greatly appreciated.
I am trying to include a question for allocating respondents' budgets.
They should be able to pick several items out of a list but should consider the items' prices, meaning the items having different prices and the total price of selected items must not be higher than the respondents' fixed budget.
I am not sure whether I could do that by using equations or assesements. Can someone share their ideas on how to implement that type of question? Thank you very much in advance.
Best,
Hans
I am new to the forum and have a question, any help is greatly appreciated.
I am trying to include a question for allocating respondents' budgets.
They should be able to pick several items out of a list but should consider the items' prices, meaning the items having different prices and the total price of selected items must not be higher than the respondents' fixed budget.
I am not sure whether I could do that by using equations or assesements. Can someone share their ideas on how to implement that type of question? Thank you very much in advance.
Best,
Hans
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 4 months ago #177439
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 Numerical Value Validation for Multiple Choice Question
You can use the Expression Manager sum() function -
manual.limesurvey.org/Expression_Manager#Implemented_Functions
So, in the question depicted below, the validation equation could be something like:
Sample survey attached:
So, in the question depicted below, the validation equation could be something like:
Code:
sum(if(Q1_SQ001 == 'Y', 30, 0), if(Q1_SQ002 == 'Y', 40, 0), if(Q1_SQ003 == 'Y', 70, 0), if(Q1_SQ004 == 'Y', 80, 0)) <= 120
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The topic has been locked.
- HalloHans
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
5 years 4 months ago #177445
by HalloHans
Replied by HalloHans on topic Numerical Value Validation for Multiple Choice Question
Hi Tony,
thank you so much. That's exactly what I was looking for.
Best;
Hans
thank you so much. That's exactly what I was looking for.
Best;
Hans
The topic has been locked.