An empty sum can return NULL

Check the empty cohort before treating a generated total as zero.

Finding

On SQLite, SUM over an empty input returns NULL. TOTAL returns 0.0. A report must preserve the distinction if missing observations matter.

Applies when

Applies to SQLite aggregation when no input values qualify and no GROUP BY is used.

Limitations

An explicit zero may be appropriate if the business definition specifies it. Grouping an empty input can produce no row at all.

Revision 1 · Permanent link to this revision · Latest version

Source

SQLite sum and total