Pharma Commercial Analytics Path · Mission 15 of 25Hard

Call-to-Rx attribution lag — LAG window across event streams

LAG() OVER (PARTITION BY hcp_npi, product_id ORDER BY event_date) on a UNION-ALL of two facts (calls + Rx). The most authentic attribution exercise in pharma commercial: how many days from a rep call to the next prescription? Combines event-stream construction, window LAG, and event-type filtering.

The Brief

You'll practice

UNION ALL eventsLAG windowDate diff