Making reports and charts agree
SQL reporting improvements and integration checks comparing exported emissions, chart totals and known expected values.
The context
A sustainability platform presented related emissions data through charts and exported reports. These different paths needed to produce consistent totals across dates and emission factors.
What I worked on
- Refactored a reporting query to join pre-resolved conversion-rate identifiers from a daily aggregate.
- Added integration tests comparing exported totals with seeded expected values and chart responses.
- Covered per-factor totals and date scenarios using an explicit numerical tolerance.
Lessons learned
A report can look plausible while being wrong. Comparing multiple outputs with known data provides a more useful check than verifying only that a file was generated.