Excerpt |
---|
Generates a random integer between a low and a high number. Two inputs may be Integer or Decimal types, functions returning these types, or column references. |
- Range is inclusive of the two parameter values.
- The first parameter must be the lower value in the range.
D code |
---|
derive type:single value: RANDBETWEEN(1,10) as:'r10' |
Output: For each row, generate a random Integer value between 1 and 10
in the new r10
function.
D code |
---|
derive type:single value: RANDBETWEEN(value1,value2) as:'random' |
Argument | Required? | Data Type | Description |
---|
value1 | Y | Integer or Decimal | Integer or Decimal literal, function returning one of these data types, or a column reference for the lower boundary of the range. Range is inclusive of this value. |
value2 | Y | Integer or Decimal | Integer or Decimal literal, function returning one of these data types, or a column reference for the upper boundary of the range. Range is inclusive of this value. |
value1, value2
Literals, functions, or column references to Integer or Decimal values that are used as the lower and upper bounds, respectively, for the range.
- Missing input values generate missing results.
- Multiple columns and wildcards are not supported.
Usage Notes:
| | |
---|
Yes | Integer or Decimal literal, function, or column reference | 100 |
Example - RANDBETWEEN, PI, and TRUNC functions
Include Page |
---|
| EXAMPLE - RANDBETWEEN and PI Functions |
---|
| EXAMPLE - RANDBETWEEN and PI Functions |
---|
|