Context
Afiniti pairs contact center callers with agents using AI and gets paid based on measured performance. That makes reporting especially important. First-call resolution (FCR) numbers for the AT&T account were used in management decisions and needed to be available on both a daily and monthly basis.
The source data lived in Snowflake, but the reporting process had grown organically over several years.
The problem
Pulling the data for a single reporting cycle took around a day. Parts of the weekly KPI reporting, including churn and agent performance, were also being assembled manually by two people.
Slow is manageable. Untrustworthy is not.
When something went wrong in the pipeline, it often failed silently. The first person to discover the problem was usually the person reading the report.
What I built
I rebuilt the pipeline end to end using a Medallion architecture with Bronze, Silver, and Gold layers, sourcing the data from Snowflake.
Bronze handled raw extracts as they came in, with the schema applied and duplicates resolved. I also added slowly changing dimension tables to track agent attributes over time. Knowing which team an agent belonged to in a specific month matters when revenue is tied to performance.
Silver was where the data became trustworthy. I added custom data quality checks to every load, along with GDPR-compliant PII masking and anonymization. Downstream consumers could work with the data without accessing raw personal information.
Gold contained the executive-facing aggregates, including the FCR and KPI tables used by the reporting layer.
I also centralized pipeline logging so failures became visible immediately, with a timestamp and stage name, instead of appearing as an incorrect number several days later. The summary was also pushed via email on every run.
Alongside the rebuild, I tuned the heaviest SQL queries and reduced runtimes on large datasets by 50% to 90%.
What made it hard
The technical work was only part of the challenge.
The existing reports were the accepted source of truth for a major client relationship. Before switching over, every layer of the new pipeline had to reconcile exactly with the existing numbers.
The data quality checks I added to the Silver layer uncovered more than five genuine data issues during the process. Those were not always easy conversations in the short term, but each issue that was found and fixed made the reporting more reliable and strengthened the client's trust in the numbers.
Outcome
Report delivery went from roughly a day to about an hour.
The two-person manual weekly KPI process was eliminated completely, with reporting automated across sites and BPOs.
More importantly, quality checks and logging were built into the pipeline from the start. The system could identify problems and make them visible without someone constantly watching it.
For me, that is the real definition of done for production data work. The pipeline should keep earning trust after you stop watching it.