· 8 min read

Zero Is a Result. Missing Data Is a Different Answer.

Share article

A dashboard displays zero overdue invoices. That could mean there are no unpaid invoices past their due dates. It could also mean the import never ran, the query found no accessible records or the selected entity has not been configured.

Those are very different situations hidden behind the same neat digit. The problem begins when an application treats a missing value as a cosmetic inconvenience and replaces it with zero before deciding what the absence means.

This is an original software design guide, not a report of an incident. The examples are fictional. The aim is to preserve enough meaning that a number, an empty result and an unavailable result cannot silently become the same answer as they move through a system.

AI-generated concept: zero, question mark and empty outline; MISSING IS NOT ZERO.
AI-generated editorial concept; not a product screenshot, incident reconstruction or company endorsement.

Decide what zero means in the domain

Zero is a value. In a count of overdue invoices, it can mean that the relevant population was examined and none met the overdue definition. That statement contains more information than the digit alone: a population, a rule and some assurance that the data needed for the check was available.

Write that meaning before choosing a database default. If the system has no completed import for the selected period, it may not be able to assert the count at all. A successful query against an empty table does not establish that the table contains the complete business population.

An invented example makes the issue plain. A newly created entity has no uploaded records. Showing “No overdue invoices found in the uploaded records” may be accurate. Showing “You have no overdue invoices” makes a broader claim that the available evidence does not support.

The domain definition should determine the display, rather than the display determining what the data is allowed to mean.

Learn the database behaviour without borrowing its meaning

PostgreSQL documents that count(*) counts rows, while count(expression) counts non-null values. It also documents that sum over no rows returns null rather than zero. Those are database behaviours; they do not decide what an incomplete business dataset means. PostgreSQL aggregate documentation

In a fictional set of three records, two amounts are known and one amount is missing. Counting records and counting known amounts answer different questions. A total of the known amounts can be arithmetically valid while still incomplete as a total for all three records.

Carry that distinction into the result contract. A reporting service can return the calculated amount together with the number of included records and the number missing required values. The exact fields depend on the product, but the user should not have to infer completeness from a number alone.

Avoid treating every null as an error. Sometimes absence is expected and meaningful. The design task is to represent the reason for absence at the layer where that reason is known.

Model absence with a small vocabulary

Create a limited set of states that correspond to different next actions. For a fictional reporting workflow, useful states might include complete, partial, not yet loaded, unavailable and not applicable. These are proposed application states, not special PostgreSQL values.

Complete means the stated calculation has the required inputs under the defined scope. Partial means a result can be shown but some relevant inputs are missing. Not yet loaded indicates a pending data step. Unavailable indicates that the system could not obtain the result. Not applicable means the question does not apply to the selected object.

Keep the vocabulary small enough for people to learn. Do not expose a dozen infrastructure error codes as if they were business statuses. Technical details can remain available for support while the product explains what the user can do next.

A good state has a consequence. Partial may invite review of missing records. Not yet loaded may lead to an import. Unavailable may require retry or investigation. Zero alone cannot express those choices.

Show completeness without inventing precision

Suppose a fictional report expects ten source files for its stated scope. Seven have loaded successfully, two are still pending and one failed validation. The chart below shows those mutually exclusive file states. It does not show financial values, customer results or measured system reliability.

Known gaps deserve their own states. Loaded successfully: 7; Still pending: 2; Failed validation: 1. Fictional illustration.
Illustrative completeness example, not a financial total, customer dataset or system benchmark. Mutually exclusive file states total ten; an expected-source register supplies the denominator.

A report based on the seven loaded files may still be useful, provided it is labelled as partial. The failed file needs a different action from the pending files, so combining all three into “missing” would lose useful information.

The expected count must itself have a basis. If the application does not know how many files should exist, it should not manufacture a completeness percentage. It can instead state which sources were included and which known dependencies remain unresolved.

This is a useful limit on dashboard enthusiasm. A progress bar is only as meaningful as its denominator. When the denominator is unknown, a clear list of included evidence is more honest than an invented percentage.

Preserve the distinction through the API

An API should not force every consumer to rediscover why a value is absent. If the reporting service knows the result is partial, return that status with the value and scope. If the request failed, do not return an ordinary successful result containing a zero simply because the frontend expects a number.

Define how consumers should handle each state. A chart may show a partial value with an explicit label. An automated decision may require a complete result. A downloadable report may need to include the completeness note beside the figure so that it survives outside the application.

Use examples in the contract. Show a complete zero, a complete positive value, a partial total and an unavailable result. These cases are more informative than a single happy-path response.

The earlier article on runtime validation considers the shape of incoming data. Here the concern extends beyond shape: a numeric field can be well formed while the surrounding claim about completeness is wrong.

Keep filters from disguising unknowns

PostgreSQL's comparison documentation explains that ordinary comparisons involving null yield unknown rather than true or false, and provides explicit null tests. This matters when a filter is meant to include or exclude records whose value is absent. PostgreSQL comparison documentation

Consider a fictional review list for records with a nonzero adjustment. A missing adjustment is not established as either zero or nonzero. The product owner must decide whether such a record belongs in a separate review queue, blocks the report or is outside the report's scope.

Do not leave that decision to an accidental query expression. Write the expected treatment in the acceptance criteria and test it with a small example. Include records with zero, positive, negative and missing values if all are possible in the domain.

The same discipline applies outside SQL. A language's truthiness rules, a default constructor or a display formatter can erase distinctions just as effectively as a database query. The business meaning must survive the whole path.

Give an AI answer the same evidence contract

An assistant summarising a report should receive its completeness state, not merely the calculated number. Otherwise it may turn a partial total into a confident sentence because the missing context never reached it.

For the fictional overdue-invoice example, the input should identify the entity, period, included records and any known gaps. The expected answer should distinguish “none found in the available records” from a broader assurance about the business. This is a proposed application design, not a measured claim about a particular model.

Test the wording with cases that share the same numeric value but differ in completeness. A complete zero and an unavailable result should not produce identical answers. If they do, the system has lost meaning somewhere between calculation and presentation.

For a related discussion, see what an accounting assistant should show with an answer. The source of the number matters, but so does the evidence that the source covers the question being asked.

Why this matters while building Arova

I’m building Arova, and the difference between an absent fact and a confirmed value is a useful design constraint for accounting workflows. A missing input should remain a reason to investigate, not become a reassuring number through formatting.

This article does not claim that any particular dashboard defect occurred in Arova. It describes the standard I want to apply when a user asks what a result means. The interface should help the user distinguish a completed check from a check the available records cannot yet support.

The practical connection is modest: preserve the explanation alongside the result. If a report is partial, that fact should remain visible in the answer, the chart and the exported document. A limitation that disappears during export has not really been communicated to the person who later relies on the file.

Test meanings, then review the copy

Build a small test fixture containing the domain states that matter. Include a genuine zero, an empty but complete population, a partial population, a failed retrieval and an inapplicable question. State the expected calculation and the expected user explanation separately.

Follow each case from storage through the API to the rendered view and any export. Look for defaults that quietly replace absence, filters that drop unknown records and summaries that omit scope. A component can behave correctly in isolation while the complete journey changes the meaning.

Finally, ask a person unfamiliar with the implementation to explain the displayed result. If they believe an incomplete check establishes that nothing is wrong, the wording needs revision even if every technical test passes.

A clean interface does not require every gap to become zero. It requires the user to understand what is known, what is missing and what action would make the answer more complete.

Share article
Related topics
data qualityPostgreSQLfinancial software

T
Full Stack Engineer at Grant Thornton Bharat. Building high-concurrency systems in Go and TypeScript.
← portfolio chat with tanmay ↗