Socrata was acquired by Tyler Technologies in 2018 and is now the Data and Insights division of Tyler. The platform is still powered by the same software formerly known as Socrata but you will see references to Data & Insights going forward.

sum(...)

sum(...)

Returns the sum of a given set of numbers

Works with the following datatypes:

This function works with 2.1 endpoint(s). What does this mean? »

The sum(...) function is most commonly used in $select aggregations to return the sum of a set of numeric values (Numbers). For example, to fetch the total amount spent on salaries in the City of Chicago:

https://data.cityofchicago.org/resource/tt4n-kn4t.json?$select=sum(annual_salary)

It can also be used in $group aggregations, like this one to get the sum of salaries by job type:

https://data.cityofchicago.org/resource/tt4n-kn4t.json?$select=job_titles,sum(annual_salary)&$group=job_titles