For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
index

ARRAY_UNIQUE_AGG() Function

Use with AI:Rippling AI ChatGPT Claude Cursor

Description​

Returns only the unique values aggregated as an array

Syntax​

ARRAY_UNIQUE_AGG(expression)

Parameters​

ParameterDescriptionData TypeRequired
expressionColumn or expression to evaluateAnyYes

Notes​

  • Works on any valid array type (Integer[], Text[], etc.)
  • Preserves the order of the input array
  • Returns NULL if the input array is NULL
  • Use WITHIN GROUP (ORDER BY ...) to control the order of unique values in the resulting array.
  • When used as a window function, include an OVER (...) clause.
  • To filter rows based on a window calculation, use QUALIFY instead of WHERE.

Example​

SELECT
ARRAY_UNIQUE_AGG(full_name) WITHIN GROUP (ORDER BY full_name)
FROM
rippling.employee.Employee
GROUP BY
department;