← Back to work
Case study · Afiniti / AT&T account

Medallion ETL rebuild for FCR reporting

1 hr
report delivery, from 1 day
80–90%
runtime cut on core SQL
0
manual steps left in the weekly cycle

Context

Afiniti pairs contact-center callers with agents using AI, and gets paid on measured performance. That makes reporting existential: first-call resolution (FCR) numbers on the AT&T account went to people making revenue decisions, on a daily and monthly cadence. The source data lived in Snowflake; the reporting around it had grown organically over years.

The problem

Pulling the data for a single reporting cycle took about a day, and parts of the weekly KPI reporting — churn, agent performance — were being assembled by hand by two people. Slow is survivable; untrustworthy isn't. When a pipeline failed, it failed silently, and the first person to find out was usually the one reading the report.

What I built

I rebuilt the pipeline end-to-end on a Medallion architecture — Bronze, Silver, Gold — sourcing from Snowflake:

  • Bronze took raw extracts as-is, with schema applied and duplicates resolved. I added slowly changing dimension (SCD) tables to track agent attributes over time, because "which team was this agent on in March" turns out to matter a lot when revenue is performance-based.
  • Silver is where the data earned trust: custom data-quality checks on every load, plus GDPR-compliant PII masking and anonymization so downstream consumers never touched raw personal data.
  • Gold held the executive-facing aggregates — the FCR and KPI tables the reports actually read from.

Everything wrote to centralized pipeline logging, so a failure announced itself with a timestamp and a stage name instead of a wrong number three days later. Alongside the rebuild I tuned the heaviest SQL, cutting runtimes on large-scale datasets by 80–90%.

What made it hard

The technical work was the smaller half. The existing reports were the source of truth for a large client relationship, so every layer of the new pipeline had to reconcile exactly against the old numbers before anything switched over. The data-quality checks I wrote for Silver surfaced more than five real data issues in the process — awkward conversations short-term, but each one strengthened the client's trust in the numbers long-term.

Outcome

Report delivery went from a day to an hour. The two-person manual weekly KPI process disappeared entirely — fully automated across sites and BPOs. And because quality checks and logging were built in rather than bolted on, the pipeline kept earning trust after I stopped watching it, which is the only definition of "done" I accept for production data work.