Zansa › Answers › Integration and BI tools
What are NULLs and why do they break calculations?
NULL means a value is unknown or missing, not zero or blank. In SQL, calculations involving NULL usually return NULL, and comparisons with NULL do not behave like normal equality, so totals, filters and joins can silently drop or distort rows.
Common effects:
- Adding a NULL to a number gives NULL.
- Aggregates like SUM and AVG ignore NULLs, which can change averages.
- WHERE column = value excludes NULL rows; you need IS NULL.
- Joins on NULL keys do not match.
Handle them deliberately using COALESCE where a default is appropriate, and use tests to flag unexpected NULLs. Decide per field whether missing should be treated as zero, unknown or an error.
Want this applied to your business? Zansa builds dashboards and forecasts for small and mid-sized companies worldwide. Start with a free intro call.
Book a call