Skip to main content

Define a Sequence

In Decipad, a sequence is a list of values separated by a step.

Creating a sequence

You can create a sequence by using the notation [start .. end by step] like this:

In Decipad, sequences can be expressed similarly to ranges, but with the addition of the by keyword to specify the step.

Sequences with units

Sequences can also include units. For example:

In this case, the sequence starts at 0 miles and increments by 2 miles until reaching 6 miles.

Date sequences

Decipad supports sequences of dates by specifying the step. For example:

In this case, the sequence includes dates from January 2021 to June 2021, with a step of one month.

The step can be specified using units such as millennium, century, decade, year, quarter, month, day, hour, minute, second, or millisecond.

This example generates a sequence of hours starting from midnight on March 15, 2021.