Math operation / inequalities using a randomly generated number. | XM Community
Skip to main content

Math operation / inequalities using a randomly generated number.

  • September 28, 2022
  • 4 replies
  • 16 views

Forum|alt.badge.img+1

Hi, here is an example of what I am trying to do. Each participant chose a number between 1-100, then the computer picks a randomly chosen number between 0-100, if their choice is greater than the randomly chosen number, they get 0. If their choice is less than the randomly chosen number, they get the randomly chosen number.
Note that not all participants get this question as this block is part of a randomizer in the survey flow.
Q1: Participants choose a number between 1-100 through a text entry question.
Q2: Participants are shown a randomly chosen number via: ${rand://int/17:20}
Q3: What I want to show them : if the value of Q1>Q2 they get 0, and if Q1Any help is highly appreciated.

4 replies

Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • 1555 replies
  • September 28, 2022

Hello Kareman_Yassin
You can create something like this:
image.pngAnd you should be good to achieve the desired result.
Hope this helps!


Forum|alt.badge.img+1
  • Author
  • 4 replies
  • September 29, 2022

Hi Deepak,

Thank you for your suggestion.
I tried to replicate what you have there but unfortunately it doesn't work.


Deepak
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+46
  • 1555 replies
  • September 29, 2022

Kareman_Yassin
You can just follow the steps below:
1 text entry question which will capture the number
3 text graphic first will generate a random number and the rest 2 will show value.
One will be based on Q1>Q2 and other Q2>Q1
NOTE: Please add page break after the text entry question.
Also including preview link of what I have created and made it work.
image.png
Hope this helps!


Forum|alt.badge.img+1
  • Author
  • 4 replies
  • October 13, 2022

Thank you Deepak so much.
It worked!