---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/arrays.md
cuppy_section: docs
cuppy_doc: ZZ84-VRF3
cuppy_doc_uuid: e81d894b-9a71-4751-a757-2ae02b6829fc
cuppy_permalink: https://cuppy.io/salesforce/d/ZZ84-VRF3
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/arrays
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: f8d52363963e612c2c9f96f2519448ecf9a1abbb59f60ee6604016231e041804
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/arrays.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 Functions

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Functions and operators for inspecting, accessing, and transforming array values. Use array functions to:

*   **Access and inspect** array elements by index or search for values.
*   **Measure and analyze** arrays by checking length and finding positions.
*   **Modify and transform** arrays by adding, removing, or deduplicating elements.
*   **Perform vector operations** for similarity searches on embeddings.

*   **1-based indexing**: Array indices start at 1, not 0.
*   **Element types**: Many functions require matching element types between arrays.
*   **NULL handling**: NULL elements are preserved unless explicitly removed with

For more information about supported types, see [Array Type](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array.html).

Access array elements and check for content:

*   [Array Subscript Access](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-subscript.html) - Get the element at the index.
*   [ARRAY_LENGTH](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-length.html) - Count the total number of elements.
*   [ARRAY_CONTAINS](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-contains.html) - Check whether a value exists.
*   [ARRAY_CONTAINS_ANY](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-contains-any.html) - Check for the overlap between arrays.
*   [ARRAY_POSITION](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-position.html) - Find the first occurrence of the value.
*   [ARRAY_POSITIONS](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-positions.html) - Find all occurrences of the value.
*   [ARRAY_TO_STRING](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-to-string.html) - Convert an array to a delimited string.

Create and build arrays:

*   [Array Constructor](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-constructor.html) - Create an array from values.
*   [ARRAY_AGG](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-agg.html) - Collect values from a group into an array.
*   [ARRAY_PREPEND](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-prepend.html) - Insert a value at the front of an array.
*   [ARRAY_APPEND](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-append.html) - Insert a value at end of an array.
*   [ARRAY_CAT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-cat.html) - Concatenate two arrays.
*   [ARRAY_GENERATE_SERIES](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-generate-series.html) - Generate a sequence array.

Sort, filter, and transform arrays:

*   [ARRAY_TRANSFORM](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-transform.html) - Apply a lambda function to each element.
*   [ARRAY_FILTER](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-filter.html) - Keep only elements matching a condition.
*   [ARRAY_SORT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-sort.html) - Sort elements in ascending or descending order.
*   [ARRAY_DISTINCT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-distinct.html) - Remove duplicate elements.
*   [ARRAY_REMOVE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-remove.html) - Remove all occurrences of a value.
*   [ARRAY_REMOVE_AT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-remove-at.html) - Remove the element at the defined position.
*   [ARRAY_COMPACT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-compact.html) - Remove all NULL elements.
*   [TRIM_ARRAY](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/trim-array.html) - Remove the last `n` elements.

Expand an array into a set of rows:

*   [`unnest`](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/unnest.html) - Expand array elements into a set of rows.

Perform vector operations for similarity searches on embeddings:

*   [DOT_PRODUCT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/dot-product.html) - Compute the scalar product of vectors.
*   [COSINE_SIMILARITY](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/cosine-similarity.html) - Measure directional similarity between arrays.
*   [BINARY_QUANTIZE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/binary-quantize.html) - Compress a vector to binary values.
*   [HAMMING_SIMILARITY](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/hamming-similarity.html) - Compare binary vectors.

Find products with specific tags.

Find products matching any search tag.

Build a complete list by combining arrays.

Clean up arrays by removing nulls and duplicates.

Double every element using a lambda expression.

Filter to keep only values above a threshold.

Find top five most similar products using embeddings

*   [Array Type](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array.html)
*   [Lambda Expressions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/lambda-expressions.html)
*   [Aggregate Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/aggregate.html)


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
