RAND( ) function
Returns a random number that falls within a specified boundary.
Syntax
RAND(number)
Parameters
Name | Type | Description |
---|---|---|
number | numeric |
The numeric boundary for the random number. If you specify a number with decimal places the random number generated has the same number of decimal places.
|
Output
Numeric.
Examples
Basic examples
Returns 278.61:
RAND(1000.00)
Returns 3781:
RAND(10000)
Note
The return value will differ with each execution of the function.
Remarks
RAND( ) cannot replicate results
If you use the RAND( ) function consecutively with the same number value, it produces different results. Unlike the RANDOM command, the RAND( ) function has no seed value.
Duplicate random numbers possible
If you use RAND( ) to create a computed field that assigns a random number to every record in a table, it is possible that duplicate random numbers are generated. There is no guarantee that the random numbers will be unique.
The larger the number value in relation to the number of records in the table, the greater the chance that the generated numbers will be unique.
Random numbers dynamically update
A computed field with the RAND( ) function generates a new set of random numbers every time you perform actions such as quick sorting, applying a filter, rearranging columns, or scrolling through the view.
If you want to fix a set of random numbers, extract the data to a new table using the View or Fields option in the Extract dialog box.