Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Check out our powerful new search update! You can read more here. Please let us know if you have any feedback by creating a topic here.
SOLVED

Random List Without Repeats

Highlighted
Meteor

I am attempting to assign teams together in a schedule. I need the first Column to randomly assign to the second. I have tried several methods but I keep getting repeated names.  I would be willing to settle for the first column just doing a rotation, but am also unable to find this answer as well. Any help would be greatly appreciated.

image.png

Alteryx Certified Partner
Alteryx Certified Partner

@TJ1

 

In the Math functions found in the Formula tool, there is a "RandInt(" function that will return a random integer. Sort by this randomly assigned integer, then a Join tool can perform a position-based join to pair up the two lists.

 

Example solution attached.

Highlighted
ACE Emeritus
ACE Emeritus

Hi!  Interesting problem.  I may have found a way to do this by separating the name columns into 2 separate streams, assigning each record in each stream a random integer (with the 'RandInt()' formula), sorting each stream by that number, and then joining the records back by record position (don't join on any field, just lump them together after the sort).  In the example below I set the RandInt function to choose an integer between 0 and 10000, and then by sorting on that number and joining on record position, I don't need to worry about the pairs needing to receive the same random number.  Setting the RandInt parameter to a higher value than the number of pairs I need to create just lowers the possibility that 2 records in the same column will get the same random number, which I think would force sort by alphabetical next, meaning you may not get as much variety as hoped for.

 

A snapshot of my workflow is below.  I just created 2 lists like yours with 6 names each for this example.  

Capture.PNG

 

 

 

Highlighted
Meteor

Thanks a lot this really helped.


@CharlieS wrote:

@TJ1

 

In the Math functions found in the Formula tool, there is a "RandInt(" function that will return a random integer. Sort by this randomly assigned integer, then a Join tool can perform a position-based join to pair up the two lists.

 

Example solution attached.


 

Highlighted
Meteor

Thank you very much for the time you put into this. This helped a lot.

 


@amanda_gray wrote:

Hi!  Interesting problem.  I may have found a way to do this by separating the name columns into 2 separate streams, assigning each record in each stream a random integer (with the 'RandInt()' formula), sorting each stream by that number, and then joining the records back by record position (don't join on any field, just lump them together after the sort).  In the example below I set the RandInt function to choose an integer between 0 and 10000, and then by sorting on that number and joining on record position, I don't need to worry about the pairs needing to receive the same random number.  Setting the RandInt parameter to a higher value than the number of pairs I need to create just lowers the possibility that 2 records in the same column will get the same random number, which I think would force sort by alphabetical next, meaning you may not get as much variety as hoped for.

 

A snapshot of my workflow is below.  I just created 2 lists like yours with 6 names each for this example.  

Capture.PNG

 

 

 



@amanda_gray
Labels