Legacy schema traps · Status, flags and deletion
Why does my SQL total not match the ERP screen?
Usually because deleted or cancelled rows are still in the table, marked by a flag. The screen hides them; a plain SUM() counts them.
What it looks likeIllustrative
ORDLIN.DELETED='J' on 4 % of lines; the screen total skips them, SUM() does not.
All table and column names are invented.
Why reports and AI agents get it wrong
Nothing in the schema says the flag matters.
A first check you can run
For one-letter columns, look at the value distribution; a small share of an unusual value is often a deletion or cancellation flag.
Read-only and on the catalogue or aggregates: it looks at structure and value counts, not at individual records.
How Janus Works handles it
The filter becomes part of every tool, and the Golden Master compares totals with the screen.
Every number verified against your own screens. Deviations shown, never hidden.
Common in the Jeeves database.