How to deal with responses summing over 100% | XM Community
Skip to main content
Solved

How to deal with responses summing over 100%

  • August 7, 2018
  • 1 reply
  • 227 views

Hi. I am a relative newcomer regarding both HTML and JavaScript. In slider question, I have 3+ answers with 0-100%. How can I set a limit that summation of my responses does not go over 100%? ( for example: 30%, 40%, 20%, 10%).

Best answer by Anonymous

Hello @Pooriaaaa , It can be done through simple math operation i.e A= 100 - (B+C+D) where A, B, C, D are the answers. In the custom validation type of the slider question type, add condition as follows -select slider question in the question option -select first option(in this case consider A) - select operator 'equal to' - add following in the last option(highlighted in the image) $e{ 100 - ( q://QID8/ChoiceNumericEntryValue/2 + q://QID8/ChoiceNumericEntryValue/3 + q://QID8/ChoiceNumericEntryValue/4 ) } Image: ! Change the formula based on your question id(QID8) This will always require to sum all the four option to equal to 100. Please let me know if you find any problem in implementing this. Preview Link of the implementation is here QSF file is attached below
View original

1 reply

  • 0 replies
  • Answer
  • August 7, 2018
Hello @Pooriaaaa , It can be done through simple math operation i.e A= 100 - (B+C+D) where A, B, C, D are the answers. In the custom validation type of the slider question type, add condition as follows -select slider question in the question option -select first option(in this case consider A) - select operator 'equal to' - add following in the last option(highlighted in the image) $e{ 100 - ( q://QID8/ChoiceNumericEntryValue/2 + q://QID8/ChoiceNumericEntryValue/3 + q://QID8/ChoiceNumericEntryValue/4 ) } Image: ! Change the formula based on your question id(QID8) This will always require to sum all the four option to equal to 100. Please let me know if you find any problem in implementing this. Preview Link of the implementation is here QSF file is attached below

Leave a Reply