
Write a PostgreSQL query to troubleshoot a mismatch between the Synechron dashboard and the source system for daily settled revenue. Return only date-region combinations where the dashboard total differs from the correctly derived source total, and include prior-day difference context for the same region.
Filtering source rows to the metric definitionJoining transactions to account attributesAggregating both systems to the same grainUsing FULL OUTER JOIN for reconciliationUsing LAG to add debugging context