📖 Story
Rapido · Captain Streaks & Earnings
Rapido pays a weekly performance bonus to captains whose total settled earnings put them in the top 40% of the fleet. The analytics team uses CUME_DIST(), which tells you what fraction of captains earned the same or less than a given captain; anyone above 0.6 gets the bonus. The catch is Jaya, a new captain whose payouts are all still pending: her total is NULL — 'not settled yet', not zero — and she shouldn't be ranked at all this week. Leaving her in the ranking doesn't just affect her row; it quietly changes everyone else's percentile too.