Random number out of set of 2 & How to use previous random number in next question | XM Community
Solved

Random number out of set of 2 & How to use previous random number in next question

  • 14 June 2021
  • 1 reply
  • 10 views

For my experiment, i need a random number of either 3 or 5. The random number function in qualtrics only provides a min and max. I found another question on this forum that says that it can be done with randomizing embedded data.
I use the following piped text: $e{ 15 - q://QID12/TotalSum + e://Field/Number}. This however, provides me with an error of  {Invalid Expression}.
Does anyone know what i have to change?
Moreover, i would like to use the random number (question 1) in a follow up question(question 2), is this possible? That would be something like this: $e{ 15 - q://QID12/TotalSum + e://Field/Number (question 1) - q://QID14/TotalSum + e://Field/Number(question 2) }
image.png

icon

Best answer by lizb311 16 June 2021, 00:23

View original

1 reply

Userlevel 4
Badge +19

danielbakker98 I think you just need to be careful with your spaces. Add a space between the end of your embedded data field and the closing } bracket. So it would be:

$e{ 15 - q://QID12/TotalSum + e://Field/Number }

Then, when editing the piped text in a survey question, try switching to the HTML view. From there, you can check your piped text to see if any of the blank spaces have been translated into the HTML
 
- that will cause your calculations to break. If you find some, simply change it from
 
to a blank space.

Leave a Reply