A dashboard can show an average and a board count that were calculated from different sets of records. Missing numeric values may be excluded from the average while every row contributes to a total count. Make those populations explicit before using the summary to describe production performance.

PostgreSQL’s aggregate-function documentation distinguishes counting rows from counting non-null values and describes aggregates that operate on non-null inputs. Check the behavior of the actual database and query rather than assuming that all summary functions use the same denominator.

Define each count separately

Record eligible boards, test attempts, executed steps, valid measurements, and passing results as distinct quantities. A row in a step table is not necessarily a completed board test, and a valid numeric measurement is not automatically a passing one.

Inspect how absent measurements are represented. Null, an empty string, a numeric sentinel, and a missing row can behave differently in queries. Preserve status fields that explain why a value is absent rather than expecting the numeric column alone to carry every condition.

Build a transparent summary

Reported item Population to state
Mean measurement Valid observations included in the calculation
Pass fraction Defined eligible or evaluated population
Missing count Expected observations without a usable result
Board count Distinct boards under the chosen identity rule

Include the valid-measurement count next to an average. For example, a mean based on a small completed subset should not be displayed as though it summarizes every board in a much larger shipment. State how incomplete boards affect the separate yield metric.

Check edge cases deliberately

  1. Evaluate a group with all valid measurements.
  2. Evaluate a group with some missing values.
  3. Evaluate a group with no valid measurements.
  4. Check repeated attempts for the same board.
  5. Compare query output with a manually understood dataset.

Do not replace an undefined average with zero unless zero is explicitly the intended display of “no data,” and label that state unmistakably. Otherwise a group with no measurements may look like a group with excellent zero-valued performance.

Review filters and joins before blaming the aggregate function. A query may already have removed failed or unmatched records before the average is calculated. Keep the population reconciliation visible from source records through the final chart.

The useful result is a summary whose numbers can be explained independently: which units were eligible, which produced valid observations, and which observations entered each statistic. That prevents a mathematically correct query from supporting an incorrect production claim.

Move from reading to a build-ready project

Use the fabrication and assembly checklists to prepare drawings, production files and test requirements.

Open the DFM checklist