`ARRAY_GENERATE_SERIES` (Numerical)

Data 360 Query Guide, mirrored from developer.salesforce.com: **Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

markdownreferencev19YHY-QBDFguide: data-cloud-query-guidestage: referencetrust: officialsource: developer.salesforce.comservice: data360interface: sql`ARRAY_GENERATE_SERIES` (Numerical)Data 360Data CloudData 360 Query Guide

Created 23 Oct 2026 · Modified 23 Oct 2026 · 1 version

Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-generate-series.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

ARRAY_GENERATE_SERIES (Numerical)

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Creates an array of sequential values within a range.

  • <start>: The starting value of the sequence.
  • <stop>: The ending value of the sequence (inclusive).
  • <step>: The increment between values. The default is 1.

Returns an array that contains sequential values from start to stop, incrementing by step.

  • If you use a negative step, make sure <start> is greater than <stop>. If <start> is less than or equal to <stop>, the function returns an empty array.
  • A negative step generates a descending sequence. A positive step generates an ascending sequence.
  • This function is equivalent to the generate_series (Numerical) function but returns an array instead of a set of rows.
  • Both the start and stop values are included in the generated series.
  • The step size must be non-zero.
  • The step size can also be negative. For negative step sizes, start must be greater than stop.
  • For positive step sizes, if start is greater than stop, the function returns no rows.
  • For negative step sizes, if start is less than stop, the function returns no rows.
  • If any input is null, the function returns no rows.

Create an array of integers from 1 to 5.

Returns [1, 2, 3, 4, 5].

Create an array of integers from 1 to 5 with step 2.

Returns [1, 3, 5].

Create an array counting down from 5 to 1 in increments of 2.

Returns [5, 3, 1].

Create a descending array with decimal values.

Returns [3.7, 3.4, 3.1].

When the step direction doesn’t match the range direction, an empty array is returned.

Returns [].

The examples in generate_series examples apply to array_generate_series.

Read this document as markdown — the same bytes an agent receives.