
Solved
Constant sum matrix sum + total sum from both rows and columns

Hi.
I need to validate a constant sum matrix by adding rows AND columns.
!
For example, I would like to ask participants to distribute 8 people in the matrix. It could be all 8 males or 8 female or 8 Whites or 8 Asians.
I've been trying to come up with code for more than 4 hours (based on this answer from @GrayMatterThinking), but still couldn't find the solution.
Thank you in advance.

Best answer by MatthewM
Hi @ahra1120 ,
What TomG says is correct, but if JS is a little too challenging to incorporate in your survey (as it can be for me), there are two other solutions using Qualtrics built-in validation that you might consider.
I don't know if the 8 that you're using to validate the sum of fields from the matrix is fixed, or if it can vary based on a previous input but you just used it for the purpose of an example. Here are solutions for either scenario.
If it is the former (8 is fixed for every respondent), then you could recreate the question in a single column Constant Sum question (Vertical Text with Total), with categories White Male, White Female, Asian Male, Asian Female, etc., and set the "Must Total" value to equal 8.
If it is the latter (that is, the validation sum does vary based on a previous input from a text entry question), then you could leave the question as is in the Matrix format and use Custom Validation. You would take the initial text entry question and in the highlighted field set it to equal a formula like the one below (replacing "##" with the corresponding QID number from your specific Matrix question).
!
$e{ q://QID##/ChoiceNumericEntryValue/1/1 + q://QID##/ChoiceNumericEntryValue/1/2 + q://QID##/ChoiceNumericEntryValue/2/1 + q://QID##/ChoiceNumericEntryValue/2/2 + q://QID##/ChoiceNumericEntryValue/3/1 + q://QID##/ChoiceNumericEntryValue/3/2 + q://QID##/ChoiceNumericEntryValue/4/1 + q://QID##/ChoiceNumericEntryValue/4/2 }
Hope these help.
View original
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.