Once you have set up the API within your environment or GraphiQL (if not please see this article - https://app.intercom.com/a/apps/wnmvofws/knowledge-hub/article/10802663).
The AnalyticsAPI supports the below aggregation functions
count
avg
max
min
stddev
stddev_pop
stddev_samp
sum
var_pop
var_samp
variance
To use this feature The name of the aggregate field is of the form:
field-name+_aggregate - an example would be tax_assessor_v2_aggregate.
Example Queries:
The below query will show you a count of records in Chicago IL that have a lot size between 5000-30000 and is built on or before 2010
query aggregatesCount {
tax_assessor_v2_aggregate(where: {
situs_state: {_eq: "IL"},
city: {_eq: "CHICAGO"},
lot_size_sq_ft: {_gte: 5000, _lte: 30000},
year_built: {_gte: 2010}}){
aggregate{
count
}
}
}
The below query will show you the average assessed value in Chicago IL
query averageTotalAssessedValue {
tax_assessor_v2_aggregate(where: {city: {_eq: "CHICAGO"}, state: {_eq: "IL"}}) {
aggregate {
avg {
assessed_value_total
}
}
}
}
If you have any further questions please reach out to us at Support@cherre.com