Generate random prices | XM Community
Skip to main content
Solved

Generate random prices

  • April 1, 2020
  • 2 replies
  • 38 views

Hi, I want to ask survey respondents if they will pay a certain price for a product, which I generated using the random number formula and stored in a variable I called price1 in the survey flow. I created another variable in survey flow called price2, which is half of price1, or e${ price1 * 0.5} If they respond that they won't buy at the first price (price1) then I ask if they will purchase at the second (price2). The survey will generate a random number for the first price but then on the next question it just says {invalid formula}. What am I doing wrong? Or is there a better way to do this? I do want to have the prices recorded as part of my data set.

Best answer by TomG

In survey flow, try: ``` price2 = $e{ e://Field/price1 * 0.5 } ```

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • Answer
  • April 1, 2020
In survey flow, try: ``` price2 = $e{ e://Field/price1 * 0.5 } ```

  • Author
  • 1 reply
  • April 3, 2020

Yes!! Thanks so much.