Hi everyone!
Is there a way to generate a random number between a set range of numbers? Let's say for example I want to create a random four digit value, I would set the parameters to generate a random number between 1000 & 9999.
Solved! Go to Solution.
Hi @VoidWhichBinds, check out the RandInt function:
Hi @VoidWhichBinds,
Subtract your lower bound from your upper bound (9999-1000 = 8999). Then use the formula with the difference in a RandInt formula plus the lower bound: RandInt(8999)+1000
Hi @VoidWhichBinds,
you can do this with the formula tool and a little trick:
RandInt(8999)+1000
Rand() * 8999 + 1000
Both ways basically work the same. Data Type is set to Int. So no matter if I use RandInt or Rand - I end up having an Integer.
Rand() will generate a number between 0 and 1 - next I multiply it with the range [9999-1000] and last I add you minimum value to it by adding 1000.
Workflow attached.
Best
Alex
Thanks for providing this solution. At first using this method was generating decimals, so I surrounded the entire formula in a FLOOR() and it rounded out the values.
hi
this is excel fx that generate random number btw 17162000000 and 17169999999
result 17168273382
Excel
=RANDBETWEEN(17162000000,17169999999)
can you help me make same in alteryx
hi
need help with this
this is a excel fx =RANDBETWEEN(17162000000,17169999999)
generate random between 17162000000 and17169999999
result 17167263726
need help making same in alteryx