Give a label to a random number generated | XM Community
Question

Give a label to a random number generated

  • 16 October 2020
  • 1 reply
  • 4 views

I want to put my respondents in an hypothetical scenario: suppose today is [dayofweek] (ex: Monday, or Friday).
In order to do so, I generate a random number between 1 and 7, and call this variable "dayofweek". If the number randomly generated by Qualtrics is 1, I want to show "suppose today is Monday", if it is 2 I want to show "suppose today is Tuesday" etc.
When I insert the embedded data field in my questionnaire, I can only show : ${e://Field/dayofweek}. So the respondent will only see "Today is 1" (or 2, or 5 depending on the number generated). Is there a way to give a label to the randomly generate number? In my case 1=Monday, 2=Tuesday etc.
Thanks!




1 reply

Userlevel 7
Badge +22

Create an embedded data - "day". Now after generating dayofweek create branch logic - if dayofweek is equal to 1 then set 'day' embedded data to "Monday" and so on. So in all we need to create 7 branch logic. Now pipe in this "day" embedded data as required.
OR
Just create a randomizer in survey flow. Under this randomizer, add 7 embedded data elements. In each embedded data elements set an embedded data "data" to Monday. Tuesday.... and so on. Insert 1 in randomizer text box i.e. insert 1 item from randomizer.

Leave a Reply