How to do same-page math operations? | XM Community
Question

How to do same-page math operations?

  • 14 April 2021
  • 1 reply
  • 18 views

Userlevel 2
Badge +10

I have a situation where I need to ask respondents for numerical values and then display the result of a math operation back to them ON THE SAME PAGE. Simplified example:
Q1) What is your hourly wage? A
Q2) How many hours per week do you work? B
(In background, multiply A*B*52 to get value C)
Q3) You have reported that your annual salary is approximately $C. Is this correct? [Y/N]
I can do the math using piped text and Qualtrics math operations, but that only seems to work if there's a page break between Qs 2 and 3. In our actual survey (which involves a more complex series of value entry boxes and calculations), I want the result to appear on the same page so that respondents can easily see and correct errors without having to move back and forth in the survey to see the results. Ideally, I would like it to work like the Constant Sum question type where the resulting sum is shown instantly.
Is there a way to do this within Qualtrics natively? Or some kind of js plug-in I could use? Thanks in advance!


1 reply

Userlevel 7
Badge +21

You can't do this natively in Qualtrics, but its a pretty short JS function that will do it for you.
If you share your QSF/survey link, I may be able to help you with the code.

Leave a Reply