How to do same-page math operations? | XM Community
Skip to main content

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!

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