`AVG`

Data 360 Query Guide, mirrored from developer.salesforce.com: **Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

markdownreferencev1Z0G8-9YJNguide: data-cloud-query-guidestage: referencetrust: officialsource: developer.salesforce.comservice: data360interface: sql`AVG`Data 360Data CloudData 360 Query Guide

Created 23 Oct 2026 · Modified 23 Oct 2026 · 1 version

Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/avg.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

AVG

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Computes the average (arithmetic mean) of all input values.

  • <expression>: An expression of any numerical type.
  • numeric with a scale of 6 for integer-type arguments and numeric arguments with a scale less than 6.
  • double precision for floating-point arguments.
  • Otherwise, returns the same as argument the type.

Returns NULL if no rows are selected.

  • NULL values are ignored in the calculation.
  • Returns NULL when applied to an empty set.
  • Use COALESCE to substitute a default value for NULL results.

Get the average price of products.

Calculate the average salary by department.

Use COALESCE to handle NULL results.

Read this document as markdown — the same bytes an agent receives.