Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

D toc
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 s
snippetBasic

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 s
snippetSyntax

D code

derive type:single value: RANDBETWEEN(value1,value2) as:'random'

ArgumentRequired?Data TypeDescription
value1YInteger or DecimalInteger 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.
value2YInteger or DecimalInteger 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.

D s lang notes

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:

Required?
Data Type
Example Value
YesInteger or Decimal literal, function, or column reference100 

D s
snippetExamples

Example - RANDBETWEEN, PI, and TRUNC functions

Include Page
EXAMPLE - RANDBETWEEN and PI Functions
EXAMPLE - RANDBETWEEN and PI Functions

D s also
labelother