Skip to main content

June 2025 Missing Downline Agent Name - Data Quality Issue

Date: 2025-01-XX Status: ✅ Fixed (after backfill)

Issue Summary

  • Tenant ID: creative_benefit_strategies
  • Period Label: 2025-06-01
  • Stage3 Row Count: 47 rows with tpa_applied=TRUE
  • Distinct Agents: 0 (all downline_agent_name were NULL/blank)
  • Impact: Top Agents dashboard showed 1 row with NULL agent_name, $6,149.73 total commission

Root Cause

downline_agent_name was copied from empty agent_name during upload/build process. The pipeline did not validate that agent_name was populated before copying to downline_agent_name.

Fixes Applied

  1. API Filter: Added AND agent_name IS NOT NULL AND TRIM(agent_name) != '' to get_top_agents_from_view() (NO FLOAT64 casts)
  2. Upload Path: Row-wise precedence for agent_name (prefer Payee Agent Label per-row, fallback to agent_name per-row), robust boolean guardrail
  3. Engine Path: Sanitized agent_name construction with proper NaN handling, guardrail
  4. Backfill: Regenerated/re-uploaded June 2025 data with corrected agent attribution

Verification

  • distinct_agents > 0 after backfill
  • blank_agents = 0 for tpa_applied=TRUE
  • analytics.top_agents no longer returns NULL agent rows
  • ✅ Dashboard June Top Agents populated correctly