Calculation Validations | XM Community
Skip to main content
Solved

Calculation Validations

  • January 26, 2022
  • 1 reply
  • 23 views

Forum|alt.badge.img

Hi Guys, is it possible to have some kind of validation that suppose:
Question 1 asks: What is your total mark in the test?....and lets say the respondent says they have 80
Question 2 asks: What are your marks in Section A.....Section B and Section C,?
l have text entry fields for each of these 3 sections, now l want a validation such that if their 3 marks they enter for section A, B and C does not add up to the number they have entered on question 1 they are told they have made an error
l don't know if its possible, if possible how can l do it?

Best answer by Tom_1842

Hi,
You should be able to accomplish this by making Question 1 a single line Text Entry question. Maybe add a validation to ensure that the respondent enters a number.
Then make Question 2 a Constant Sum question. Obtain the value from Question 1 by getting the Piped Text from the Rich Text editor and then add the Piped Text into the "Must Total" Validation for Question 2, like in the below:
ConstantSum_Equals_TextEntry.pngConstantSum_Equals_TextEntry_example.png

1 reply

Tom_1842
Level 8 ●●●●●●●●
Forum|alt.badge.img+28
  • Level 8 ●●●●●●●●
  • Answer
  • February 11, 2022

Hi,
You should be able to accomplish this by making Question 1 a single line Text Entry question. Maybe add a validation to ensure that the respondent enters a number.
Then make Question 2 a Constant Sum question. Obtain the value from Question 1 by getting the Piped Text from the Rich Text editor and then add the Piped Text into the "Must Total" Validation for Question 2, like in the below:
ConstantSum_Equals_TextEntry.pngConstantSum_Equals_TextEntry_example.png