ArrayIntersection

The ArrayIntersection function compares two arrays and returns an array of all overlapping elements, without duplicates. The output array is unordered.

📘

This function isn't compatible with all data platform connections. To check if your connection supports it, see Supported data platforms and feature compatibility.

Syntax

ArrayIntersection(array1, array2)

Function arguments:

array1Array to be compared for overlapping elements.
array2Array to be compared for overlapping elements.

Notes

  • If either or both input arguments are null values, the function returns null.
  • The function is “null aware”. If both input arrays contain a null element, the returned array will contain one.
  • If there are no overlapping values, an empty array is returned.

Example

A table lists all the available colors of different clothing items. To see what items are available in black or white, you can use the ArrayIntersection function:

ArrayIntersection([Colors], Array("black", "white"))

ArrayIntersection compares the arrays listed in the [Colors] column with the ("black", "white") array.

Example use of ArrayIntersection. A table with 3 columns - Items (listing clothing items), Colors (array of colors the item comes in), and ArrayIntersection (displaying function output).

Both “black” and “white” are present in the Colors column for Shoes, so ArrayIntersection returns an array with both colors. As nothing is listed in the Pants row, the function returns a null value.