Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r0811

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 lang vs sql

D s
snippetBasic

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value: randbetween(1,10) as:'r10'

randbetween(1,10)

Output: Generates a random Integer value between 1 and 10.

D s
snippetSyntax

D lang syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value: RANDBETWEEN(value1,value2) as:'random'

RANDBETWEEN(value1,value2)


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