Skip to content

Instantly share code, notes, and snippets.

@abbhinavs
abbhinavs / pql-vs-mql-sam-conversion-v2.sql
Created April 15, 2026 17:58
PQL vs MQL Lead Volume and SAM Conversion by Quarter — using fnd_sfdc.meeting SAM definition (Lead-Level)
-- PQL vs MQL Lead Volume and SAM Conversion by Quarter
-- Level: Lead (inquiry-based, not org-deduped)
-- SAM source: fnd_sfdc.meeting (Inbound SDR, Meeting Completed, Manager Approved)
-- Lead type: PQL = campaign_type_v2 = 'Confluent Cloud Sign-Up', MQL = everything else
-- SAM-to-lead mapping: most recent MQL before the SAM date via DLF
WITH leads AS (
SELECT
inquiry_id,
lead_or_contact_id,
@abbhinavs
abbhinavs / pql-vs-mql-sam-conversion.sql
Created April 15, 2026 17:28
PQL vs MQL Lead Volume and SAM Conversion by Quarter (Lead-Level)
-- PQL vs MQL Lead Volume and SAM Conversion by Quarter
-- Level: Lead (inquiry-based, not org-deduped)
-- Source: dwh_inbound_funnel.denormalized_lead_funnel
-- Lead type: PQL = campaign_type_v2 = 'Confluent Cloud Sign-Up', MQL = everything else
-- SAM definition: new_is_real_meeting = TRUE
WITH leads AS (
SELECT
inquiry_id,
mql_date_time,