Problems / Time to Convert / Editorial
GROUP BY user_id
MIN(purchase_time)
DATE_DIFF('hour', signup_time, first_purchase_time)
AVG
ROUND(..., 2)
F.expr("TIMESTAMPDIFF(HOUR, ...)")
DATE_DIFF
F.expr
datediff
Time-to-convert is a per-entity duration averaged at a coarser grain — and the wrong-grain version is seductively easy to write. AVG over a signups×purchases join weights users by how *many* purchases they made: a shopaholic with 10 orders pulls the channel average toward their later purchases. Collapsing to first-purchase-per-user *before* joining fixes the weighting so every converter counts exactly once.
Solve Time to Convert yourself →