Generation of specific numbers randomly? | XM Community
Question

Generation of specific numbers randomly?

  • 18 June 2021
  • 5 replies
  • 212 views

Dear members of Qualtrics community.
I want to ask you for advice regarding random number generator. I'm familiar with the random number generator using piped text (e. g. ${rand://int/1:3}), but I need to generate randomly only specific numbers, not numbers of a specific range. In the given example I need to assign randomly only number 1 or number 3, not a number from the range of 1 to 3. Is there any possibility to modify the standard command for a random number generator or a different way how I can reach my goal?
Thank you for any advice.


5 replies

Userlevel 7
Badge +21

Have you read the support pages on randomizer?

ahmedA of course, I read (e.g. https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/standard-elements/randomizer/#EditingCounts ; https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/piped-text/piped-text-overview/#RandomNumberGenerator) and also tried to find if someone else has asked this sort of question. Unfortunately, I don't think that I found an answer (I'm sorry if I missed something).
I also tried to use a comma in the command ${rand://int/1,3}, but this solution is not working.

Userlevel 7
Badge +21

Did you see this? https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/standard-elements/randomizer/#UsingTheRandomizerWithOtherElements

https://community.qualtrics.com/discussion/comment/38461#Comment_38461Yes, I saw this manual, but I'm not sure how to use these instructions for my situation.
Maybe it would be better if I will be more specific regarding my need.
I have two numeric values (embedded data) in my data file, and I need to assign one of two specific values randomly to a new embedded data variable if the values of the source embedded variables are equal. After that, I will continue to work with respondents based on this new embedded data variable value.
obrazek.pngNote: In this case, you can see that I tried to use a semicolon instead of a colon standardly used in the original command (found in Piped text -> Random number) – ${rand://int/1:3}.

Userlevel 7
Badge +21

image.pngI'm a little confused. Doesn't this do exactly what you are looking for? It assigns one condition randomly to the paricipants.

Leave a Reply