Generate a random number using a previously generated random number? | XM Community
Skip to main content
Solved

Generate a random number using a previously generated random number?

  • March 25, 2019
  • 2 replies
  • 27 views

Hey there! I am trying to generate a set of random numbers in a survey. I am using the embedded data so that I can store the random numbers because I will need them for analysis. I generate the first one as follows: Number1 = ${rand://float/0:50} And I am embedding this number into a question. Then I want to ask a question that calls a random number in the range of 0 to Number1. Something like this: Number2 = ${rand://float/0:${e://Field/Number1}} but all I get out when I call Number2 is '}' Any thoughts? Thanks!

Best answer by TomG

@jasonmaier, You can't nest piped text, which means you can't make a Qualtrics rand pipe dynamic. You'll probably have to calculate Number2 in JavaScript.

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • Answer
  • March 25, 2019
@jasonmaier, You can't nest piped text, which means you can't make a Qualtrics rand pipe dynamic. You'll probably have to calculate Number2 in JavaScript.

  • Author
  • 1 reply
  • March 25, 2019
Tom, Thanks for replying. I figure out a way to do it. You can use piped text in Qualtrics web services as a query parameter. Seems a little long form, but a satisfactory work around. Thanks again.