Multiplying and display logic | XM Community
Skip to main content

Hello, I am new to qualtrics and coding. I was wondering if there is a way to have two questions be asked with a number response to each and then have these number be multiplied and the answer used in a display logic later on. I have read through the math operations page but am unclear on how to go about this. Thank you for you help!

Yes, this can be done by piping the values of the two questions into a math operation that assigns the result to an Embedded Data field. The catch is that the place where the result is displayed has to be in a separate block from the two questions.
Here's a simple example. First, the questions:
image.pngNext, the Embedded Data. I named the field "Result" in this example. The value is assigned by taking the piped values from the two questions and using math operations (the code $e{ ...} wraps around the QIDs) to multiply them. The QID numbers will be different in your survey; temporarily pipe them into a question in your survey editor to find them for both questions. Note that the Embedded Data field has to be assigned before the block where the result is displayed, otherwise it won't show up to the respondent.
image.pngFinally, pipe in the Embedded data field into your second block.
image.pngGood luck!


Thank you so much! This is very helpful. How would i use this embedded data in a flow logic if I wanted a question to only be shown if the product was a certain number?


You should be able to use Display Logic at either the question or block level. It would be something like this example (which is at the question level, and only displays when the result = 😎.
image.png


Leave a Reply