This page explains how to use the range function in APL.
range
function in APL to create a dynamic array of evenly spaced values. You can generate numeric, datetime, or timespan sequences that increase by a constant step, which defaults to 1 for numbers and 1 hour for time-based types. The function stops once the value exceeds the specified endpoint or the maximum result size.
range
is useful when you want to produce test values, synthetic sequences, time intervals, or loop-like constructs without relying on input data. It helps you populate arrays that can be expanded or joined with real data for further analysis.
Splunk SPL users
makeresults
combined with streamstats
or manual iteration logic. APL’s range
function simplifies this by producing arrays of equally spaced values directly.ANSI SQL users
range
is more concise and efficient for creating sequences without writing complex recursion logic.Name | Type | Required | Description |
---|---|---|---|
start | scalar (number, datetime, timespan) | ✔️ | First value in the array. |
stop | scalar (same type as start ) | ✔️ | Upper bound of the array. The last value is less than or equal to stop . |
step | scalar (same type as start ) | Difference between values. Defaults to 1 (numeric) or 1h (time). |
start
, incremented by step
, up to and including stop
(if it aligns exactly with a step). The array truncates if it reaches the system limit of 1,048,576 elements.
['sample-http-logs']
.