ARRAY_REMOVE

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns a new array with all instances of a specified element removed.

Syntax 

1ARRAY_REMOVE(<array>, <element>)

Arguments 

Required 

  • <array>: The source array.
  • <element>: The value to remove.

Returns 

Returns an array with all occurrences of the specified element removed.

Considerations 

  • Removes all occurrences of the element, not just the first.
  • If the element isn’t found, the original array is returned unchanged.

Examples 

Remove All Occurrences 

Remove all instances of a value from an array.

1SELECT ARRAY_REMOVE(array[1, 2, 1, 3], 1) AS result;

Returns array[2, 3], removing both occurrences of 1.

Related Documentation 

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!