Skip to main content

RANGE

Deprecated version

This document refers to a deprecated version of the RQL programming language.

Please go here for documentation related to the latest supported version.

Returns a collection of integers or timestamps between low and high, with an optional step.

  • If low and hi are integers then it will return a collection of integers, step has to be an integer and if not specified defaults to 1.
  • If low and hi are dates or timestamps then it will return a collection of timestamps, step has to be an interval and if not specified it defaults to interval "1 day"
Syntax
RANGE(<lo>, <hi> [, <step>])
Example
RANGE(0,3)  // [0, 1, 2]
RANGE(0,6,2) // [0, 2, 4]

RANGE(date "2022-02-28", date "2022-03-02") // [timestamp "2022-02-28 00:00:00", timestamp "2022-03-01 00:00:00"]
RANGE(date "2022-01-01", date "2023-01-1", interval "4 months") // [timestamp "2022-01-01 00:00:00", timestamp "2022-05-01 00:00:00", timestamp "2022-09-01 00:00:00"]
RANGE(timestamp "2022-02-27 00:00:00", timestamp "2022-02-28 00:00:00", interval "12 hours") // [timestamp "2022-02-27 00:00:00", timestamp "2022-02-27 12:00:00"]