Category: Arrays

CARDINALITY

CARDINALITY returns the number of elements in an array, for example how many values COLLECT gathered per group.

Syntax

CARDINALITY(array)

AMC specifics

  • Together with COLLECT it counts, for example, how many different campaigns or products a user saw.
  • With COLLECT without DISTINCT it counts duplicates as well.

Related functions: COLLECT, EXPLODE, ARRAY_INTERSECT

Source: advertising.amazon.com (retrieved 2026-10-09)