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
  • HalloHans's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 4 months ago #177418 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
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177439 by tpartner
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:

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:

File Attachment:

File Name: limesurvey...1-27.lss
File Size:20 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • HalloHans
  • HalloHans's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 4 months ago #177445 by HalloHans
Hi Tony,

thank you so much. That's exactly what I was looking for.

Best;
Hans
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose