ARRAY_LENGTH

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the total number of elements in an array.

Syntax 

1ARRAY_LENGTH(<array>)

Arguments 

Required 

  • <array>: The array to measure.

Returns 

Returns an integer that represents the total number of elements in the array.

Considerations 

  • Returns the count of all elements including NULL and duplicate values.
  • For an empty array, returns 0.

Examples 

Count Array Elements 

Determine the number of elements in an array.

1SELECT ARRAY_LENGTH(array[1, 2, 3]) AS element_count;

Returns 3, counting all elements in the array.

Related Documentation 

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