Constant Sum - I want to require the "total" to be a range between two fixed numbers | XM Community
Skip to main content

I have a constant sum question where students are rating each other on a team assignment.  The Likert scale is 1 to 5 (required range 0-5).  There are seven students in each group, the student does not rate themselves (only 0 response).  The total must be between 12 and 24.  How do I force the “total” to be the range between 12 and 24?

 

@rubieszw,

Use custom validation:

Choice1 Is Less than or equal to $e{ 24 - q://QIDx/ChoiceNumericEntryValue/2 - q://QIDx/ChoiceNumericEntryValue/3 - q://QIDx/ChoiceNumericEntryValue/4 - q://QIDx/ChoiceNumericEntryValue/5 - q://QIDx/ChoiceNumericEntryValue/6 - q://QIDx/ChoiceNumericEntryValue/7 }

AND

Choice1 Is Greater than or equal to $e{ 12 - q://QIDx/ChoiceNumericEntryValue/2 - q://QIDx/ChoiceNumericEntryValue/3 - q://QIDx/ChoiceNumericEntryValue/4 - q://QIDx/ChoiceNumericEntryValue/5 - q://QIDx/ChoiceNumericEntryValue/6 - q://QIDx/ChoiceNumericEntryValue/7 }

Where QIDx is the QID of the constant sum question and Choice1 is the first row of the constant sum.


@TomG thanks so much.  To clarify, I have to code each row of the constant sum question with both statements?  

 


@TomG thanks so much.  To clarify, I have to code each row of the constant sum question with both statements?  

 

No, you only need the condition on the first row.  It is a round about way of validating the total.


@TomG amazing, that worked!  I truly appreciate it.


Hello, I would like to have a total between 1 to 4. I added below codes in custom validation but still doesn’t work. What’s wrong on it? Thanks.

 

Choice1 Is Less than or equal to 
$e{ 4 - q://QID14/ChoiceNumericEntryValue/2 - q://QID14/ChoiceNumericEntryValue/4 - q://QID14/ChoiceNumericEntryValue/6 }


Choice1 Is Greater than or equal to 
$e{ 1 - q://QID14/ChoiceNumericEntryValue/2 - q://QID14/ChoiceNumericEntryValue/4 - q://QID14/ChoiceNumericEntryValue/6 }

 

 


The numbers at the end of the piped fields are choice ids, not recodes - most probably 1, 2, 3 and 4. You can pipe them into your question text to confirm.


@TomG Thanks for your reply. I changed the codes as below but the total is still greater than 4. Is the QID15 is equal to question no. (Q15)?
 

Choice1 Is Less than or equal to 
$e{ 4 - q://QID15/ChoiceNumericEntryValue/2 - q://QID15/ChoiceNumericEntryValue/3 - q://QID15/ChoiceNumericEntryValue/4 }


Choice1 Is Greater than or equal to 
$e{ 1 - q://QID15/ChoiceNumericEntryValue/2 - q://QID15/ChoiceNumericEntryValue/3 - q://QID15/ChoiceNumericEntryValue/4 }

 

 

 


@TomG I found correct QID and it worked now. Thanks for your help!


Leave a Reply