# Function: RandEx

### Description

Returns a record's random number in the range 0-4294967295. This is an expanded version of the Rand function, which only returns numbers in the range 0-32767.

### Syntax

RandEx()

### Arguments

None.

### Return value

This function returns a number in the range of 0-4294967295.

### Calculated field example

To generate a field filled with random numbers, use the following calculated field expression:

RandEx()

This application of the RandEx() function has application in certain areas, such as auditing (see Filter example, below).

### Filter/Find example

Certain tasks, such as auditing, require that you generate a random subset of the table database. This can be done in Monarch Classic using the RandEx() function. A random group of records can be selected using the filter expression:

RandEx()>=300.And.RandEx()<=350

You may use any numeric range in the set of numbers from 0-4294967295 to select a random group of records. You should be aware, however, that with this use of the RandEx function, the number of records returned is variable. If none of the randomly generated numbers happen to fall within the range you specify, Monarch Classic will return a blank table database.

(c) 2023 Altair Engineering Inc. All Rights Reserved.