{
  "id": "sales",
  "order": 1,
  "title": "Where should sales focus next quarter?",
  "kicker": "Inbound Sales · Marketplace",
  "roles": [
    "SDR/BDR",
    "Inside Sales",
    "Sales Ops",
    "Partnerships"
  ],
  "question": "Which lead sources, landing pages and seller types should SDRs and reps work first, and which closed sellers actually start selling?",
  "source": {
    "name": "Marketing Funnel by Olist",
    "url": "https://www.kaggle.com/datasets/olistbr/marketing-funnel-olist",
    "license": "CC BY-NC-SA 4.0",
    "publisher": "Olist",
    "as_of": "November 2018",
    "rows_raw": 8000,
    "rows_used": 8000,
    "caveat": "Real but anonymized and randomly sampled by Olist: 8,000 of its marketing qualified leads from a Brazilian marketplace, June 2017 to May 2018. Seller sales come from Olist's separate public orders data, which may not hold every order.",
    "joined": "Brazilian E-Commerce Public Dataset by Olist (orders and order items), https://www.kaggle.com/datasets/olistbr/brazilian-ecommerce, CC BY-NC-SA 4.0",
    "mirror": "https://github.com/mara/mara-olist-ecommerce-data (data/, commit 663660ed), byte-identical to Kaggle's listed file sizes"
  },
  "cleaning": [
    "Joined all 842 closed deals to the 8,000 marketing qualified leads on mql_id: every deal matched one lead, so the table has one row per lead and a won flag.",
    "Conversion and time to close use the 5,998 leads first contacted from January to May 2018. The closed deals file has no deal won before December 5, 2017, so a 2017 lead that closed earlier cannot be told apart from one that never closed (2017 leads show 0% to 5.5% conversion by month).",
    "Joined each won seller to Olist's public orders data on seller_id, counting orders that were not canceled or unavailable and summing their item prices (Brazilian reais). The sale check uses sellers won by May 31, 2018, since the orders data effectively ends in August 2018 (16 orders in September, 4 in October).",
    "Kept the publisher's labels: 'unknown' is an origin value in the source, separate from the 48 2018 leads (60 overall) with no origin at all.",
    "days_to_close is won date minus first contact date. One deal is recorded as won 2 days before its first contact date; it is kept as published.",
    "Did not use declared monthly revenue: it is 0 for 797 of 842 won leads. has_company, has_gtin, average_stock and catalog size are blank for most deals too."
  ],
  "kpis": [
    {
      "label": "Lead to deal conversion",
      "value": "13.0%",
      "note": "of 5,998 leads first contacted Jan to May 2018"
    },
    {
      "label": "Search leads that closed",
      "value": "14.7%",
      "note": "vs 6.3% from social and 4.0% from email"
    },
    {
      "label": "Median days to close",
      "value": "12 days",
      "note": "first contact to won, 781 deals from 2018 leads"
    },
    {
      "label": "Won sellers who made a sale",
      "value": "51.7%",
      "note": "of 665 won by May 2018, orders through Aug 2018"
    }
  ],
  "filters": [
    {
      "id": "business_type",
      "label": "Seller type",
      "options": [
        "All",
        "Reseller",
        "Manufacturer"
      ]
    }
  ],
  "charts": [
    {
      "id": "conversion_by_origin",
      "kind": "bar",
      "title": "Lead to deal conversion by channel",
      "subtitle": "Organic and paid search closed 14.7% and 14.8%. Social brought 1,051 leads but closed 6.3%. 'Unknown' is Olist's own label for 813 leads with no tracked channel. Leads first contacted Jan to May 2018.",
      "x": "label",
      "y": "conversion_pct",
      "color": null,
      "x_label": "Channel (origin)",
      "y_label": "Conversion",
      "format_y": "%",
      "filter_fields": [],
      "data": [
        {
          "origin": "(null)",
          "leads": 48,
          "won": 13,
          "conversion_pct": 27.1,
          "median_days_to_close": 7.0,
          "label": "Not recorded"
        },
        {
          "origin": "unknown",
          "leads": 813,
          "won": 168,
          "conversion_pct": 20.7,
          "median_days_to_close": 10.0,
          "label": "Unknown"
        },
        {
          "origin": "paid_search",
          "leads": 1182,
          "won": 175,
          "conversion_pct": 14.8,
          "median_days_to_close": 13.0,
          "label": "Paid search"
        },
        {
          "origin": "organic_search",
          "leads": 1736,
          "won": 255,
          "conversion_pct": 14.7,
          "median_days_to_close": 13.0,
          "label": "Organic search"
        },
        {
          "origin": "direct_traffic",
          "leads": 380,
          "won": 54,
          "conversion_pct": 14.2,
          "median_days_to_close": 9.5,
          "label": "Direct traffic"
        },
        {
          "origin": "referral",
          "leads": 211,
          "won": 24,
          "conversion_pct": 11.4,
          "median_days_to_close": 18.5,
          "label": "Referral"
        },
        {
          "origin": "other_publicities",
          "leads": 41,
          "won": 3,
          "conversion_pct": 7.3,
          "median_days_to_close": 35.0,
          "label": "Other publicity"
        },
        {
          "origin": "display",
          "leads": 75,
          "won": 5,
          "conversion_pct": 6.7,
          "median_days_to_close": 10.0,
          "label": "Display"
        },
        {
          "origin": "social",
          "leads": 1051,
          "won": 66,
          "conversion_pct": 6.3,
          "median_days_to_close": 23.0,
          "label": "Social"
        },
        {
          "origin": "email",
          "leads": 347,
          "won": 14,
          "conversion_pct": 4.0,
          "median_days_to_close": 19.5,
          "label": "Email"
        },
        {
          "origin": "other",
          "leads": 114,
          "won": 4,
          "conversion_pct": 3.5,
          "median_days_to_close": 9.0,
          "label": "Other"
        }
      ]
    },
    {
      "id": "sold_by_lead_type",
      "kind": "bar",
      "title": "Closed sellers who made a sale, by lead type",
      "subtitle": "72.7% of big online sellers sold something within the data, against 32.9% of offline and 38.0% of industry sellers. Sellers won by May 2018.",
      "x": "label",
      "y": "sold_pct",
      "color": "business_type",
      "x_label": "Lead type",
      "y_label": "Sold at least once",
      "format_y": "%",
      "filter_fields": [
        "business_type"
      ],
      "data": [
        {
          "business_type": "All",
          "lead_type": "online_medium",
          "sellers": 270,
          "sold": 157,
          "sold_pct": 58.1,
          "item_revenue_brl": 193253.0,
          "median_revenue_if_sold_brl": 545.0,
          "label": "Online, medium"
        },
        {
          "business_type": "All",
          "lead_type": "online_big",
          "sellers": 99,
          "sold": 72,
          "sold_pct": 72.7,
          "item_revenue_brl": 263185.0,
          "median_revenue_if_sold_brl": 889.0,
          "label": "Online, big"
        },
        {
          "business_type": "All",
          "lead_type": "industry",
          "sellers": 92,
          "sold": 35,
          "sold_pct": 38.0,
          "item_revenue_brl": 27631.0,
          "median_revenue_if_sold_brl": 422.0,
          "label": "Industry"
        },
        {
          "business_type": "All",
          "lead_type": "offline",
          "sellers": 82,
          "sold": 27,
          "sold_pct": 32.9,
          "item_revenue_brl": 18502.0,
          "median_revenue_if_sold_brl": 281.0,
          "label": "Offline"
        },
        {
          "business_type": "All",
          "lead_type": "online_small",
          "sellers": 63,
          "sold": 27,
          "sold_pct": 42.9,
          "item_revenue_brl": 52388.0,
          "median_revenue_if_sold_brl": 547.0,
          "label": "Online, small"
        },
        {
          "business_type": "All",
          "lead_type": "online_beginner",
          "sellers": 43,
          "sold": 18,
          "sold_pct": 41.9,
          "item_revenue_brl": 21681.0,
          "median_revenue_if_sold_brl": 441.0,
          "label": "Online, beginner"
        },
        {
          "business_type": "All",
          "lead_type": "online_top",
          "sellers": 12,
          "sold": 5,
          "sold_pct": 41.7,
          "item_revenue_brl": 5235.0,
          "median_revenue_if_sold_brl": 1245.0,
          "label": "Online, top"
        },
        {
          "business_type": "All",
          "lead_type": "(null)",
          "sellers": 4,
          "sold": 3,
          "sold_pct": 75.0,
          "item_revenue_brl": 45079.0,
          "median_revenue_if_sold_brl": 740.0,
          "label": "Not recorded"
        },
        {
          "business_type": "Manufacturer",
          "lead_type": "online_medium",
          "sellers": 71,
          "sold": 38,
          "sold_pct": 53.5,
          "item_revenue_brl": 35045.0,
          "median_revenue_if_sold_brl": 429.0,
          "label": "Online, medium"
        },
        {
          "business_type": "Manufacturer",
          "lead_type": "industry",
          "sellers": 50,
          "sold": 17,
          "sold_pct": 34.0,
          "item_revenue_brl": 9460.0,
          "median_revenue_if_sold_brl": 605.0,
          "label": "Industry"
        },
        {
          "business_type": "Manufacturer",
          "lead_type": "online_small",
          "sellers": 22,
          "sold": 5,
          "sold_pct": 22.7,
          "item_revenue_brl": 810.0,
          "median_revenue_if_sold_brl": 150.0,
          "label": "Online, small"
        },
        {
          "business_type": "Manufacturer",
          "lead_type": "online_big",
          "sellers": 19,
          "sold": 13,
          "sold_pct": 68.4,
          "item_revenue_brl": 21570.0,
          "median_revenue_if_sold_brl": 798.0,
          "label": "Online, big"
        },
        {
          "business_type": "Manufacturer",
          "lead_type": "offline",
          "sellers": 18,
          "sold": 3,
          "sold_pct": 16.7,
          "item_revenue_brl": 2673.0,
          "median_revenue_if_sold_brl": 389.0,
          "label": "Offline"
        },
        {
          "business_type": "Manufacturer",
          "lead_type": "online_beginner",
          "sellers": 14,
          "sold": 3,
          "sold_pct": 21.4,
          "item_revenue_brl": 2773.0,
          "median_revenue_if_sold_brl": 904.0,
          "label": "Online, beginner"
        },
        {
          "business_type": "Manufacturer",
          "lead_type": "online_top",
          "sellers": 4,
          "sold": 3,
          "sold_pct": 75.0,
          "item_revenue_brl": 2455.0,
          "median_revenue_if_sold_brl": 909.0,
          "label": "Online, top"
        },
        {
          "business_type": "Reseller",
          "lead_type": "online_medium",
          "sellers": 195,
          "sold": 118,
          "sold_pct": 60.5,
          "item_revenue_brl": 157308.0,
          "median_revenue_if_sold_brl": 559.0,
          "label": "Online, medium"
        },
        {
          "business_type": "Reseller",
          "lead_type": "online_big",
          "sellers": 80,
          "sold": 59,
          "sold_pct": 73.8,
          "item_revenue_brl": 241615.0,
          "median_revenue_if_sold_brl": 922.0,
          "label": "Online, big"
        },
        {
          "business_type": "Reseller",
          "lead_type": "offline",
          "sellers": 62,
          "sold": 22,
          "sold_pct": 35.5,
          "item_revenue_brl": 15528.0,
          "median_revenue_if_sold_brl": 285.0,
          "label": "Offline"
        },
        {
          "business_type": "Reseller",
          "lead_type": "online_small",
          "sellers": 41,
          "sold": 22,
          "sold_pct": 53.7,
          "item_revenue_brl": 51579.0,
          "median_revenue_if_sold_brl": 768.0,
          "label": "Online, small"
        },
        {
          "business_type": "Reseller",
          "lead_type": "industry",
          "sellers": 39,
          "sold": 18,
          "sold_pct": 46.2,
          "item_revenue_brl": 18171.0,
          "median_revenue_if_sold_brl": 409.0,
          "label": "Industry"
        },
        {
          "business_type": "Reseller",
          "lead_type": "online_beginner",
          "sellers": 29,
          "sold": 15,
          "sold_pct": 51.7,
          "item_revenue_brl": 18908.0,
          "median_revenue_if_sold_brl": 235.0,
          "label": "Online, beginner"
        },
        {
          "business_type": "Reseller",
          "lead_type": "online_top",
          "sellers": 8,
          "sold": 2,
          "sold_pct": 25.0,
          "item_revenue_brl": 2781.0,
          "median_revenue_if_sold_brl": 1390.0,
          "label": "Online, top"
        },
        {
          "business_type": "Reseller",
          "lead_type": "(null)",
          "sellers": 4,
          "sold": 3,
          "sold_pct": 75.0,
          "item_revenue_brl": 45079.0,
          "median_revenue_if_sold_brl": 740.0,
          "label": "Not recorded"
        }
      ]
    },
    {
      "id": "conversion_by_landing_page",
      "kind": "bar",
      "title": "Conversion by landing page",
      "subtitle": "The two busiest pages closed 21.7% and 23.0% of their leads; the third busiest closed 5.5%. Pages with 100+ leads, Jan to May 2018.",
      "x": "page",
      "y": "conversion_pct",
      "color": null,
      "x_label": "Landing page (anonymized id)",
      "y_label": "Conversion",
      "format_y": "%",
      "filter_fields": [],
      "data": [
        {
          "landing_page_id": "b76ef37428e6799c421989521c0e5077",
          "leads": 751,
          "won": 163,
          "conversion_pct": 21.7,
          "page": "b76ef3"
        },
        {
          "landing_page_id": "22c29808c4f815213303f8933030604c",
          "leads": 726,
          "won": 167,
          "conversion_pct": 23.0,
          "page": "22c298"
        },
        {
          "landing_page_id": "58326e62183c14b0c03085c33b9fdc44",
          "leads": 495,
          "won": 27,
          "conversion_pct": 5.5,
          "page": "58326e"
        },
        {
          "landing_page_id": "ce1a65abd0973638f1c887a6efcfa82d",
          "leads": 346,
          "won": 56,
          "conversion_pct": 16.2,
          "page": "ce1a65"
        },
        {
          "landing_page_id": "88740e65d5d6b056e0cda098e1ea6313",
          "leads": 306,
          "won": 26,
          "conversion_pct": 8.5,
          "page": "88740e"
        },
        {
          "landing_page_id": "40dec9f3d5259a3d2dbcdab2114fae47",
          "leads": 297,
          "won": 64,
          "conversion_pct": 21.5,
          "page": "40dec9"
        },
        {
          "landing_page_id": "f017be4dbf86243af5c1ebed0cff36a2",
          "leads": 224,
          "won": 20,
          "conversion_pct": 8.9,
          "page": "f017be"
        },
        {
          "landing_page_id": "e492ee5eaf1697716985cc6f33f9cd9b",
          "leads": 214,
          "won": 9,
          "conversion_pct": 4.2,
          "page": "e492ee"
        },
        {
          "landing_page_id": "a7982125ff7aa3b2054c6e44f9d28522",
          "leads": 132,
          "won": 15,
          "conversion_pct": 11.4,
          "page": "a79821"
        },
        {
          "landing_page_id": "73f31a40697cc90a86c1273563ac230e",
          "leads": 113,
          "won": 4,
          "conversion_pct": 3.5,
          "page": "73f31a"
        }
      ]
    },
    {
      "id": "days_to_close",
      "kind": "bar",
      "title": "Days from first contact to won",
      "subtitle": "Half of the deals from 2018 leads closed within 12 days and 54.5% within two weeks.",
      "x": "bucket",
      "y": "share_pct",
      "color": "business_type",
      "x_label": "Days",
      "y_label": "Share of won deals",
      "format_y": "%",
      "filter_fields": [
        "business_type"
      ],
      "data": [
        {
          "business_type": "All",
          "bucket": "7 or less",
          "deals": 283,
          "share_pct": 36.2
        },
        {
          "business_type": "All",
          "bucket": "8 to 14",
          "deals": 143,
          "share_pct": 18.3
        },
        {
          "business_type": "All",
          "bucket": "15 to 30",
          "deals": 126,
          "share_pct": 16.1
        },
        {
          "business_type": "All",
          "bucket": "31 to 60",
          "deals": 85,
          "share_pct": 10.9
        },
        {
          "business_type": "All",
          "bucket": "61 to 90",
          "deals": 41,
          "share_pct": 5.2
        },
        {
          "business_type": "All",
          "bucket": "Over 90",
          "deals": 103,
          "share_pct": 13.2
        },
        {
          "business_type": "Reseller",
          "bucket": "7 or less",
          "deals": 202,
          "share_pct": 37.1
        },
        {
          "business_type": "Reseller",
          "bucket": "8 to 14",
          "deals": 87,
          "share_pct": 16.0
        },
        {
          "business_type": "Reseller",
          "bucket": "15 to 30",
          "deals": 89,
          "share_pct": 16.3
        },
        {
          "business_type": "Reseller",
          "bucket": "31 to 60",
          "deals": 58,
          "share_pct": 10.6
        },
        {
          "business_type": "Reseller",
          "bucket": "61 to 90",
          "deals": 30,
          "share_pct": 5.5
        },
        {
          "business_type": "Reseller",
          "bucket": "Over 90",
          "deals": 79,
          "share_pct": 14.5
        },
        {
          "business_type": "Manufacturer",
          "bucket": "7 or less",
          "deals": 79,
          "share_pct": 35.4
        },
        {
          "business_type": "Manufacturer",
          "bucket": "8 to 14",
          "deals": 52,
          "share_pct": 23.3
        },
        {
          "business_type": "Manufacturer",
          "bucket": "15 to 30",
          "deals": 35,
          "share_pct": 15.7
        },
        {
          "business_type": "Manufacturer",
          "bucket": "31 to 60",
          "deals": 26,
          "share_pct": 11.7
        },
        {
          "business_type": "Manufacturer",
          "bucket": "61 to 90",
          "deals": 10,
          "share_pct": 4.5
        },
        {
          "business_type": "Manufacturer",
          "bucket": "Over 90",
          "deals": 21,
          "share_pct": 9.4
        }
      ]
    }
  ],
  "finding": "Search is the channel to work first: organic and paid search leads closed 14.7% of the time in early 2018, against 6.3% for social and 4.0% for email, even though social brought 1,051 leads. The landing page matters as much: the two busiest pages closed 21.7% and 23.0%, the third busiest 5.5%. Closing is not the finish line. Only 51.7% of sellers won by May 2018 made a sale by August, and big online sellers did best at 72.7%; they were 14.9% of those sellers but brought 42.0% of all their item revenue.",
  "recommendation": "Route search leads, and leads from the two strongest landing pages, to SDRs first, and work them inside two weeks, since half of the deals from 2018 leads closed within 12 days. Move social and email leads to a nurture track until marketing finds out why they close at less than half the search rate, and fix origin tracking: 813 leads came in as 'unknown' and closed 20.7%. Give rep time to big and medium online sellers, and add an onboarding check after close for offline and industry sellers, since fewer than 4 in 10 of them made a sale.",
  "in_role": "At Green Solar I kept 100+ active opportunities moving in Velocify and sent leadership weekly reports on outreach, conversion rates and revenue. This is the report I would want next to that one: conversion by lead source and landing page, and whether a closed account actually goes live. In an SDR or sales ops seat I would bring the social and email gap to marketing first, since it changes which leads reach the team at all.",
  "method_sql": "SELECT origin, count(*) AS leads,\n       count(*) FILTER (WHERE won) AS won,\n       round(100.0 * count(*) FILTER (WHERE won) / count(*), 1) AS conversion_pct\nFROM seller_leads\nWHERE first_contact_date >= DATE '2018-01-01'\nGROUP BY origin\nORDER BY conversion_pct DESC",
  "table": {
    "name": "seller_leads",
    "file": "sales.parquet",
    "rows": 8000,
    "columns": [
      {
        "name": "mql_id",
        "type": "VARCHAR",
        "desc": "Marketing qualified lead id (anonymized hash, as published)"
      },
      {
        "name": "first_contact_date",
        "type": "DATE",
        "desc": "Date of the lead's first contact request"
      },
      {
        "name": "landing_page_id",
        "type": "VARCHAR",
        "desc": "Landing page where the lead was acquired (anonymized id)"
      },
      {
        "name": "origin",
        "type": "VARCHAR",
        "desc": "Type of media where the lead was acquired, as recorded by Olist (NULL for 60 leads)"
      },
      {
        "name": "won",
        "type": "BOOLEAN",
        "desc": "True if the lead appears in Olist's closed deals file, meaning it signed up as a seller"
      },
      {
        "name": "won_date",
        "type": "TIMESTAMP",
        "desc": "Date the deal was closed (won leads only)"
      },
      {
        "name": "days_to_close",
        "type": "BIGINT",
        "desc": "won_date minus first_contact_date, in days (won leads only)"
      },
      {
        "name": "seller_id",
        "type": "VARCHAR",
        "desc": "Seller id after sign-up; joins to Olist's e-commerce orders data"
      },
      {
        "name": "sdr_id",
        "type": "VARCHAR",
        "desc": "Sales development representative id (anonymized)"
      },
      {
        "name": "sr_id",
        "type": "VARCHAR",
        "desc": "Sales representative id (anonymized)"
      },
      {
        "name": "business_segment",
        "type": "VARCHAR",
        "desc": "Lead's business segment, informed on contact"
      },
      {
        "name": "lead_type",
        "type": "VARCHAR",
        "desc": "Lead type, informed on contact (e.g. online_big, offline, industry)"
      },
      {
        "name": "lead_behaviour_profile",
        "type": "VARCHAR",
        "desc": "Behaviour profile the SDR identified on contact (cat, eagle, wolf, shark)"
      },
      {
        "name": "has_company",
        "type": "BOOLEAN",
        "desc": "Whether the lead has a company (formal documentation); mostly blank"
      },
      {
        "name": "has_gtin",
        "type": "BOOLEAN",
        "desc": "Whether the lead has GTIN barcodes for its products; mostly blank"
      },
      {
        "name": "average_stock",
        "type": "VARCHAR",
        "desc": "Lead's declared average stock; mostly blank"
      },
      {
        "name": "business_type",
        "type": "VARCHAR",
        "desc": "Type of business: reseller, manufacturer or other"
      },
      {
        "name": "declared_product_catalog_size",
        "type": "DOUBLE",
        "desc": "Lead's declared catalog size; mostly blank"
      },
      {
        "name": "declared_monthly_revenue",
        "type": "DOUBLE",
        "desc": "Lead's declared monthly revenue; 0 for 797 of 842 won leads"
      },
      {
        "name": "seller_orders",
        "type": "BIGINT",
        "desc": "Orders for this seller in Olist's public orders data, excluding canceled and unavailable (won leads only)"
      },
      {
        "name": "seller_item_revenue_brl",
        "type": "DOUBLE",
        "desc": "Sum of item prices on those orders, Brazilian reais (won leads only)"
      },
      {
        "name": "seller_first_order_date",
        "type": "DATE",
        "desc": "Date of the seller's first such order"
      }
    ]
  },
  "sample_queries": [
    {
      "label": "Conversion by landing page (100+ leads)",
      "sql": "SELECT left(landing_page_id, 6) AS page, count(*) AS leads, count(*) FILTER (WHERE won) AS won, round(100.0 * count(*) FILTER (WHERE won) / count(*), 1) AS conversion_pct FROM seller_leads WHERE first_contact_date >= DATE '2018-01-01' GROUP BY 1 HAVING count(*) >= 100 ORDER BY leads DESC"
    },
    {
      "label": "Won sellers who made a sale, by lead type",
      "sql": "SELECT lead_type, count(*) AS sellers, count(*) FILTER (WHERE seller_orders > 0) AS sold, round(100.0 * count(*) FILTER (WHERE seller_orders > 0) / count(*), 1) AS sold_pct, round(sum(seller_item_revenue_brl)) AS item_revenue_brl FROM seller_leads WHERE won AND won_date < TIMESTAMP '2018-06-01' GROUP BY 1 ORDER BY sellers DESC"
    },
    {
      "label": "Deals and days to close by sales rep (anonymized)",
      "sql": "SELECT left(sr_id, 6) AS sales_rep, count(*) AS deals, median(days_to_close) AS median_days_to_close, count(*) FILTER (WHERE seller_orders > 0) AS sellers_who_sold FROM seller_leads WHERE won AND first_contact_date >= DATE '2018-01-01' GROUP BY 1 ORDER BY deals DESC"
    }
  ]
}