AI basics & verificationPractical AI workflows

AI table extraction: keep missing values separate from zero

An AI-extracted table can look tidy because every cell is filled while quietly turning not provided into zero. That can change filtering and totals. This guide checks whether the meaning of the input survives extraction. It addresses source fidelity rather than formula correctness or the status of a generated table as an original record.

Calculator and papers in a folder on a dark surface
Illustrative photo: Kelly Sikkema · Unsplash License

What changed: Expanded the existing verbal fixture into a raw table, deliberately failed JSON and complete corrected JSON, explaining what two unresolved rows allow you to conclude.

Key Takeaways

Define raw text, interpreted value, status and source location separately. Zero should represent a zero explicitly recorded in the source. Keep missing or unreadable information as an empty value with a status instead of inventing zero. Compare rows before calculating; parseable JSON and fixed fields establish format, not factual accuracy.

In this article

Read headings, units and footnotes first

Use an authorized copy and inspect column names, units, merged cells and footnotes. A dash may mean missing or have a business-specific meaning; a blank is not automatically missing either. Define states from this document's explanation. If it has none, mark the interpretation unresolved rather than borrowing conventions from another table.

For image inputs, use the OCR and proofreading guide to inspect digits, labels and row boundaries. An OCR draft, an AI table and the original image are different records. Keep the source and location markers so an early recognition error does not become an accepted fact through repeated formatting.

Separate format constraints from factual review

The official Claude structured-output documentation describes constraining results to a specified structure, including support for null values. It also documents refusal and truncated-output cases. No API request was executed for this article; the source establishes format capabilities.

Our editorial recommendation is to preserve raw, value, status and source. Raw records visible characters; value holds a confirmed number or an empty value; status identifies zero, missing or unresolved information; source locates the page and row. Accept structural compliance and faithful extraction separately. A parseable file should not enter a real ledger solely because software can read it.

Include interpretation rules in the task

  1. Identify the document version and target columns. Extract visible content only: do not estimate, complete values from the web or replace missing data with zero.
  2. Provide row-location markers and request raw characters, units and states. Mark unreadable content unresolved and identify its location.
  3. Use only the source's own footnote to interpret symbols. Do not guess the meaning of an unexplained mark.
  4. Begin with a small sample and request an extraction plus an uncertainty list. Compare it with the original before extending the task.

An example instruction: using only this table, output item, raw, value, status and source for each row. Preserve zero, apply the stated footnote, flag blanks or blurred content for review, and do not total unresolved values. This is an authored instruction, not an observed product result.

Inspect four rows with different states

This fictional fixture uses units of items and defines its footnote as: a dash means not provided; a blank needs review. Row r1, item A, is 12. Row r2, item B, is 0. Row r3, item C, is a dash. Row r4, item D, is blank. These are authored demonstration records, not real orders or cloud-model test data.

  • r1: retain raw 12, numeric value 12, provided status and the unit items.
  • r2: retain raw 0, numeric value 0 and explicitly provided zero status; do not change it to missing.
  • r3: retain the dash, leave the numeric value empty, mark not provided and preserve the footnote location.
  • r4: retain the original blank, leave the value empty and mark needs review; do not infer a number from neighboring rows.

Reject the extraction if r3 and r4 both become zero. Even if a spreadsheet calculation runs, the source meaning has changed.

Put all four states in one fully comparable fixture

Expand the earlier authored four-row exercise into this complete table. It is page 2, with unit items and footnote p2.f1: a dash means not provided; a blank needs review. Quotation marks only visualize the blank cell on this page; the source has no quotation marks and JSON raw should be an empty string. Do not infer a quantity from neighboring rows or turn the footnote into a fifth item.

An extraction task can say: “Extract p2.r1–r4 only. Preserve item, raw, value, unit, status and source, with the footnote location for symbol interpretations. Fill value only when the source explicitly provides a number; use null for not provided or needs review. List unresolved locations. Calculate only a subtotal of confirmed numbers, not the full total.” This is an editorial input and task, not an API or model execution result.

Complete authored source table; quotation marks visualize an empty cell; unit: items
LocationitemRaw quantity
p2.r1A12
p2.r2B0
p2.r3C—
p2.r4D"" (blank in source)

Parseable JSON does not establish a complete total

The left output is deliberately wrong; the right is a human-authored reference correction. The failure fills C and D with zero while discarding raw characters, statuses and locations. Its total still happens to be 12, hiding the lost uncertainty. The correction retains B’s explicit zero, C’s not-provided state and D’s need for review, and labels 12 as a known subtotal.

A supported statement is “The two confirmed rows have a subtotal of 12 items; two other rows are unresolved, so a complete total cannot be given.” Neither “the total is 12” nor “two items are missing” follows: two rows lack confirmed information, not two known physical items. Preserve their unit as well. A null is not a business decision to substitute zero.

If the owner later confirms C is 5, retain the original version and dash and record 5 in a separately verified version with confirmation source and time. Do not silently rewrite p2.r3’s raw text as a source-provided 5. The known subtotal becomes 17, but D still prevents a complete total. Parsing, structural compliance and arithmetic can all pass while meaning is wrong. Check row alignment, characters, units, footnotes and states before deciding whether the business rules permit a full sum.

Failed JSON and a reference repair of the same authored table

Deliberately failed JSON

{ "rows": [ { "item": "A", "value": 12, "unit": "items" }, { "item": "B", "value": 0, "unit": "items" }, { "item": "C", "value": 0, "unit": "items" }, { "item": "D", "value": 0, "unit": "items" } ], "total": 12 }

JSON retaining evidence and unresolved states

{ "rows": [ { "item": "A", "raw": "12", "value": 12, "unit": "items", "status": "provided", "source": "p2.r1" }, { "item": "B", "raw": "0", "value": 0, "unit": "items", "status": "explicit-zero", "source": "p2.r2" }, { "item": "C", "raw": "—", "value": null, "unit": "items", "status": "not-provided", "source": "p2.r3", "footnote": "p2.f1" }, { "item": "D", "raw": "", "value": null, "unit": "items", "status": "needs-review", "source": "p2.r4", "footnote": "p2.f1" } ], "knownSubtotal": { "value": 12, "unit": "items", "complete": false, "unresolvedRows": [ "r3", "r4" ] } }

Both JSON documents parse. The repair preserves source information and uncertainty rather than changing the known 12. complete:false explicitly marks the subtotal as incomplete.

Review extraction before formulas and business use

Compare row count, item labels and source locations first. Check for omitted or duplicated rows and headings mistaken for records. Then inspect digits, symbols, units and states, especially zero versus O, 1, decimal points and minus signs. An uncertainty list should locate the specific cell; a generic reminder to check manually is insufficient.

After accepting the extraction, follow the sample-row formula verification guide to inspect calculations. Rules for missing values in totals come from the business process, not an unannounced model decision. Confirm permission before sending sensitive records to an external AI service. That upload is not local processing, and automatic organization does not constitute a formal audit of financial or business records.

Common questions

What if the source does not explain its dashes?

Keep the original character and mark its interpretation unresolved. Ask the source owner; do not assume zero, missing or not applicable.

Does valid JSON remove the need to inspect cells?

No. Structure does not establish agreement with source numbers, units or states. Check missing rows, duplicates and unreadable characters as well.

Can I replace every blank with zero before calculating?

Only if an explicit business rule allows that transformation and you retain the original values and change record. Otherwise it turns unknown information into a confirmed zero; resolve it first.

Further reading & sources

Newer articles on this topic

Continue with a newer article that refers to this guide or explainer.