arraySum
Calculates the sum of all the values in an array.
The arraySum function returns the sum of numeric values in a collection or array. This function operates on a single array value, ignoring null and missing values.
To calculate the sum across multiple rows in an iterative context, use the sum function instead.
Arguments
Array of numeric values.
Examples
Calculate the sum of prices stored in an array:
WITH $prices = ( FROM product SELECT price )
SELECT arraySum($prices)Calculate the total of values in an array field:
FROM daily_sales
SELECT {
date,
total_sales = arraySum(sales_amounts)
}