Having a question validate if two answers add to a total | XM Community
Skip to main content

Hi -
I have a questions that asks how many children do you have? I then have 2 follow-up questions that ask how many biological and how many stepchildren. Is there a way to program an error message if the number of bio plus the number of step do not add to the total number of children? Example"
A3. How many children do you have?
        ________ENTER NUMBER
   A3a. How many stepchildren do you have?  ____  ENTER NUMBER
A3b. How many biological or adopted children do you have ____ ENTER NUMBER
****CAN WE MAKE IT THAT IF IT DOESN’T ADD TO A3 AND ERROR MESSAGE SHOWS?



Hi ebony_haley618 ,
Yes, one way you do this is to set up A3 in a Text Entry question with Content Validation --> Number Content Type:
image.pngThen, make A3a and A3b part of a Constant Sum question with a Total Box. Use "Must Total" Validation Type and pull the Qualtrics code for question A3 and paste it into the Choices Must Total field. You can find the code for question A3 by going to the Piped Text menu in a question and locating that item. The code should look something like "${q://QIDXX/ChoiceTextEntryValue}" (replacing "XX" with the actual ID number assigned by Qualtrics.
image.png


Leave a Reply