How to assign a random number in the current column

Hello
I have list of IDs in which you can see a duplication of ID number (e.g ID: 22222) total of 100 duplicates. How can I assign a random number to them so that they are not removed in the process of duplication removal?
image

Hello, sepehr485.

I’m curious as to the process involved, as well as the end result you’re looking for.

Do you have a list of #s from another process that you need to weed out dupes from, replacing them with other numbers, or are you, yourself, generating a list of values and you need to make sure they’re unique?

Craig

Hi Craig
I have a generated list already that I need to make a random number out f it so that they are not eliminated in the process of duplication removal. Thanks

I had a rudimentary workflow going, but it’s missing the “final piece”…

  1. Read the list in and Enumerate Rows (you’ll need this later).
  2. Derive 2 tables
  3. In the second table, Keep Duplicates.
  4. Add a new column using the “randbetween()” function to create random replacement values.
  5. Merge these back into the first derived table (here’s where you can use the Row #s).
  6. Create a formula to to keep the old # if the new # is “empty”, otherwise use the new #.

That’s all well an good, but the “missing piece” is a loop that ensures that the new random numbers aren’t dupes of #s in your original list. And that’s were it gets tricky.

I believe you’d need to throw the Repeat action at this, but honestly, I haven’t done too much with that action and haven’t gotten it to do what it needs to do (i.e., return the dataset when there are no more duplicate values).

If you’re able to work that out, or if someone in the Community is more familiar with Repeat and can work out the logic, I think you’d have your final answer.

Craig

If the purpose is to keep them from deduplication, it doesn’t have to be a random number. Just different (e.g. sequential) numbers would work. Use the “Enumerate rows” action to enumerate each identical value by grouping by “ID”.