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

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.

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


Hi Deepak,

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


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!


Thank you Deepak so much.
It worked!


Leave a Reply