Constant sum validation: must total + custom validation | XM Community
Solved

Constant sum validation: must total + custom validation


Hi all,

I have a constant sum question, and I would like validation to depend on two things:
1. The total must equal a value entered in the previous question
2. If a value has been entered for the “other maths” line, then the text box on that line must not be empty.

!

I can do (1) with piped text, using the “must total” validation option, or I can do (2) using custom validation. However, I can’t seem to do both at once. The custom validation option doesn’t seem to have the ability to do anything with the total.

Does anyone know how to achieve this?
icon

Best answer by TomG 6 June 2018, 14:58

View original

14 replies

Userlevel 7
Badge +27
On your "Other maths" choice, click on the down arrow and select Text Entry Validation/Force Response.
Thank you! I can't believe I didn't try that 😕 I assumed it would force a response regardless, but obviously didn't give it a go. Thanks again.
Hi Yvonna, were you ever able to come up with a solution for your first question (validating a total in a Constant Sum question with a response to a previous question? Thanks so much!
Hiya,
No, not really. I ended up piping the answer from the previous question into the question text and saying that their total for the current question should equal that. Not perfect, but I got fewer invalid responses with the text reminder than without it.
Thanks for the input, I ended up doing the same!
Userlevel 7
Badge +30
I came across this while trying to find a parallel to a different problem I have. Instead of using the Constant Sum question type, have you tried setting this up in a Matrix question type with a single column, and selecting Constant Sum under the Matrix Type options? You can then select "Must Total" Validation Type and pipe the value you're trying to match from the previous question in the "Choices Must Total" field.
!
!
Userlevel 5
Badge +11

https://community.qualtrics.com/XMcommunity/discussion/comment/11330#Comment_11330Thank You so much. This really helped!!!
Also, this can be done in constant sum question type!!

Userlevel 2
Badge +2

Hi,

Does anyone know if we can have both Total Box (Statements & Scale Points)?

I am trying to understand what are the total sums in a row, and column.

image.png(I have added the last column manually - but this is what I am trying to do)

Thanks in advance

Userlevel 7
Badge +27

https://community.qualtrics.com/XMcommunity/discussion/comment/51058#Comment_51058Qualtrics only supports one or the other. You could use JavaScript to add the other.

Userlevel 2
Badge +2

Hi TomG,
Thanks for the suggestion. Although, I am no developer.
Do you know if there is already any Javascript done for this purpose?

Thanks

Userlevel 7
Badge +27

https://community.qualtrics.com/XMcommunity/discussion/comment/51082#Comment_51082Not that I am aware of. Feel free to contact me by private message if you're interested having someone create it.

Userlevel 7
Badge +27

https://community.qualtrics.com/XMcommunity/discussion/comment/51058#Comment_51058I now have a function that does this. See csmAddTotals.

Userlevel 4
Badge +22

Is it even possible to use piped text as the total in validation for either the Constant Sum or Matrix-Constant Sum Question types? I’ve seen it referenced above for @Yvonna’s initial question and @MatthewM’s later suggestion of using the Constant Sum Matrix instead. I’ve been trying both and it’s not working at all. 

For context, I have a numeric amount saved to an embedded variable (classified as number set). The validation doesn’t work if I enter an amount below the value (e.g., if the variable is set to 10 earlier in the survey, my constant sum adds up to 3, but I’m able to submit the survey without any validation kickback).

 

Userlevel 7
Badge +30

Is it even possible to use piped text as the total in validation for either the Constant Sum or Matrix-Constant Sum Question types? I’ve seen it referenced above for @Yvonna’s initial question and @MatthewM’s later suggestion of using the Constant Sum Matrix instead. I’ve been trying both and it’s not working at all. 

For context, I have a numeric amount saved to an embedded variable (classified as number set). The validation doesn’t work if I enter an amount below the value (e.g., if the variable is set to 10 earlier in the survey, my constant sum adds up to 3, but I’m able to submit the survey without any validation kickback).

 

It definitely works for me in a Matrix Table-Constant Sum type question, but I have only piped in values from other questions on the same survey; I’ve never tried piping in the value from an Embedded Data field into the Must Total field.

Here are a couple of things to look into and rule out, if you haven’t already, and a couple of things to experiment with:

  • Make sure that the Embedded Data field appears before this question in the Survey Flow.
  • Make sure that the value is being written to the Embedded Data field as expected.
  • Try classifying the field as a number instead of number set.
  • Try renaming the field so it does not contain a space.

Hope you’re able to resolve this issue!

Leave a Reply