How to deal with responses summing over 100% | XM Community
Skip to main content
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%).
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