Berserk Docs
Tabular OperatorsOther Operators

range

Generates a single-column table of values in an arithmetic sequence.

Syntax

range columnName from start to stop step step

Generate values from start to stop (inclusive) with the given step increment.

Parameters

NameDescription
columnNameName of the output column
startStarting value (int, long, real, datetime, or timespan)
stopEnding value (inclusive if exactly reachable)
stepIncrement between values (must be same type as start/stop, or timespan for datetime)

Examples

Example 1 — Generate years spanning the Viking Age

range year from 793 to 1066 step 50
year (long)
1043
793
843
893
943
993

Example 2 — Generate a week of sailing days

range day from datetime(2024-06-01) to datetime(2024-06-07) step 1d
day (datetime)
2024-06-01T00:00:00Z
2024-06-02T00:00:00Z
2024-06-03T00:00:00Z
2024-06-04T00:00:00Z
2024-06-05T00:00:00Z
2024-06-06T00:00:00Z
2024-06-07T00:00:00Z

Example 3 — Generate ship watch rotation times

range watch from 0h to 24h step 4h
watch (timespan)
00:00:00
04:00:00
08:00:00
1.00:00:00
12:00:00
16:00:00
20:00:00

Example 4 — Generate oar positions along a longship

range oar_position from 1 to 30 step 1
oar_position (long)
1
10
11
12
13
14
15
16
17
18
19
2
20
21
22
23
24
25
26
27
28
29
3
30
4
5
6
7
8
9

On this page