Dec 16, 2022 10:18 AM
I'm trying to randomly assign one of four Group IDs (AlphaGroup, BetaGroup, GammaGroup, DeltaGroup) to all existing/new records in my database whether they're imported in bulk or added manually. I've been using this formula—however since some of my records will be imported in bulk, their created time remains the same and gives them all the same Group ID). I also have First Name, Last Name, Email, and other fields that could potentially be useful here. Any idea how to address this? Thanks!
IF(
SECOND( CREATED_TIME() ) < 15,
"AlphaGroup",
IF(
SECOND( CREATED_TIME() ) < 30,
"BetaGroup",
IF(
SECOND( CREATED_TIME() ) < 45,
"GammaGroup",
"DeltaGroup"
)))
Solved! Go to Solution.
Dec 20, 2022 07:24 AM
Probably something like this:
IF(
MOD(Autonumber - 1, 4) = 0, 1,
IF(
MOD(Autonumber - 2, 4) = 0, 2,
IF(
MOD(Autonumber - 3, 4) = 0, 3,
4
)
)
)
Dec 17, 2022 04:18 AM
How about using an autonumber field and whether it's divisible instead? Less random(ish) than your current solution, but would split evenly?
Dec 19, 2022 09:37 AM
Thanks @TheTimeSavingCo. That sounds like a great solution. How would you write the code/formula assuming we create an autonumber field?
Dec 20, 2022 07:24 AM
Probably something like this:
IF(
MOD(Autonumber - 1, 4) = 0, 1,
IF(
MOD(Autonumber - 2, 4) = 0, 2,
IF(
MOD(Autonumber - 3, 4) = 0, 3,
4
)
)
)