Forum Discussion

ahumke's avatar
ahumke
Helper I
6 years ago

RAND function how to randomly assign to groups

I'm trying to create a measure that will randomly assign people in my file to a treatment group or a control group if their score is above a threshold.  I've found the RAND command will generate a random number so I was thinking I could do a two step to assign groups.

 

Random Assignment = if ('Tuesday, July 7, 2020'[Weighted Average Score] > 3, RAND()*(2-1)+1)
Success Coach Assignment = if ('Tuesday, July 7, 2020'[Random Assignment] <1.50, "Yes")
 
This doesn't seem to be working though - each time I run the "Student Coach Assignment" field it seems to rerun the random assignment field - therby doing the Success Coach Assignment on the prior run values (meaning the assignment rule isn't followed) and the other problem is that once a person is assigned a value I don't want it to change for that person. The data will get updated and refreshed periodically to add people but the individual person should remain the same and I don't want their values to change at all.
 
Is there a way to make it work that way?
 
Thanks!

3 Replies