How to create embedded data? (math operation - round number) | XM Community
Skip to main content
Solved

How to create embedded data? (math operation - round number)

  • January 11, 2021
  • 3 replies
  • 127 views

Forum|alt.badge.img


Hello all,

I would like to measure how much people are willing to spend and give choice options that are 10%, 20%, 30% higher than their answers.
For example, if someone says he's willing to spend '$40', then on the next page, he will be given '$44', '$48', '$52', '$56'
Capture.PNG
I also would like to round the numbers just in case. (Ex. $45 => $50(from 49.5), $54).
Here is the embedded data that I create for 10% above option and it displays nothing in the preview.
Capture2.PNG
Do you have any idea how to fix it?
Thanks in advance



Best answer by PraDeepKotian_XM

Hi S_smith
Could you please check the survey flow and the placement of these embedded variables? By looking at the questions screen capture it seems both the questions are in same block and calculations is done after or before the block because of which you are not able to piped text/calculate the values in question text.
Also correct the math operations for 10above using this link.

3 replies

PraDeepKotian_XM
QPN Level 5 ●●●●●
Forum|alt.badge.img+21
  • QPN Level 5 ●●●●●
  • Answer
  • January 11, 2021

Hi S_smith
Could you please check the survey flow and the placement of these embedded variables? By looking at the questions screen capture it seems both the questions are in same block and calculations is done after or before the block because of which you are not able to piped text/calculate the values in question text.
Also correct the math operations for 10above using this link.


Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • January 11, 2021

The issue is that you are not referencing the embedded data

Q111
. Qualtrics is interpreting your code literally and multiplying Q111 with 1.1, which throws an error. Hence,
10above
is empty.
These two should produce the same results:
  1. $e{ round( q://QID1/TotalSum * 1.1 ) }

  2. $e{ round( e://Field/Q111 * 1.1 ) }

You can find the syntax here


Forum|alt.badge.img
  • Author
  • January 12, 2021

Thank you both!! I've solved the issue :-)