Constant Sum | XM Community
Skip to main content

image.pngMy total must be between 0 and 100.
What code should I add?

know_nothing This thread might help you.


I appreciate the effort but I'm far from being a Java expert so I need a more specific explanation.
The code is great but it doesn't accomplish what I need as it has variables that I am unsure how to identify in my project. Thanks !


Hi know_nothing ,
You don't need to code anything.
You can use inbuilt feature of Qualtrics for it, known as "Range requirements" in validation section.
image.pngThere you can set any range value as per your requirement.
For checking total sum to be 100 you can put validation "must total" be 100.
image.pngimage.png
Hope it resolves your query😊!!!


Range requirement applies to the individual inputs, not the total.
JavaScript isn't needed.
Use custom validation with an arithmetic expression. For example, if the QID of your constant sum question was QIDx and you had three rows (not including Total):
If Choice1 Is Less Than or Equal to $e{ 100 - q://QIDx/ChoiceNumericEntryValue/2 - q://QIDx/ChoiceNumericEntryValue/3 }


Duplicate post deleted


Leave a Reply