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_namewere 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
- API Filter: Added
AND agent_name IS NOT NULL AND TRIM(agent_name) != ''toget_top_agents_from_view()(NO FLOAT64 casts) - Upload Path: Row-wise precedence for
agent_name(prefer Payee Agent Label per-row, fallback to agent_name per-row), robust boolean guardrail - Engine Path: Sanitized
agent_nameconstruction with proper NaN handling, guardrail - Backfill: Regenerated/re-uploaded June 2025 data with corrected agent attribution
Verification
- ✅
distinct_agents > 0after backfill - ✅
blank_agents = 0fortpa_applied=TRUE - ✅
analytics.top_agentsno longer returns NULL agent rows - ✅ Dashboard June Top Agents populated correctly