← All work

Olist E-Commerce Logistics & Customer Intelligence

An end-to-end analytics study of 99,441 Brazilian e-commerce orders (R$ 16.0M GMV) diagnosing supply chain bottlenecks (Haversine distance vs 2x cross-state lead time) and customer retention through a 9-segment RFM model.

SQLPython (Pandas & Haversine)Power BI (DAX & Power Query)SPSS Statistical TestingRFM Customer Modeling

Problem

High customer churn (97.0% one-time buyers) and significant delivery lead time disparities (averaging 14.7 days for cross-state shipments vs 7.5 days for local orders) created margin erosion and customer dissatisfaction across Brazil's 27 states.

Data

The working records and data signals are described in the local project narrative below.

Approach

Engineered a relational analytics pipeline across 9 tables (1.55M records) using SQL, Python, Power BI (Power Query + DAX), and SPSS; computed Haversine geodesic shipping distances and built a non-linear 9-tier RFM customer segmentation matrix.

System

GEOSPATIAL SUPPLY CHAIN BOTTLENECK • OLIST BRAZIL (27 STATES)

Geographic Revenue Monopoly & Cross-State Lead Time Disparity

INTERACTIVE BRAZIL MAP (HOVER ANY STATE)27 STATES (UF)
ACAMRRAPPAROTOMAPICERNPBPEALSEBAMTGODFMSMGESRJSPPRSCRS
■ Southeast Core (62.5%)■ South (14.6%)□ Other
STATE TELEMETRY

São Paulo [SP]

SOUTHEAST • Top City: São Paulo (R$ 2.11M)
NATIONAL GMV37.4%
TOTAL REVENUER$ 5770.3k
ORDER VOLUME40,501 orders
AVG LEAD TIME7.8 Days
AVERAGE TICKET (AOV)R$ 142.5
ACTIVE SELLERS1849 (59.7%)
CROSS-STATE TRANSIT21.4%
SUPPLY CHAIN TELEMETRY INSIGHT:

Primary marketplace engine. Generates 37.4% of national GMV and houses 59.7% of all active sellers.

DISTANCE VS TRANSIT DURATION SPECTRUM (6 HAVERSINE DISTANCE TIERS):2.0x LEAD TIME DISPARITY (7.48d SAME-STATE VS 14.68d CROSS-STATE)
< 50 km5.7 DaysMetro / Local11.7k orders
50 – 200 km7.6 DaysIntra-State Road12.9k orders
200 – 500 km11.7 DaysRegional Neighbor30.3k orders
500 – 1,000 km13.8 DaysInter-State Trunk25.7k orders
1,000 – 2,000 km17.5 DaysLong-Haul Corridor9.7k orders
> 2,000 km20.7 DaysContinental Remote5.6k orders
CUSTOMER INTELLIGENCE & RETENTION • OLIST BRAZIL

9-Tier Behavioral RFM Retention Matrix

🎯 97.0% of buyers purchase only once. High-ticket single buyers drive 68.3% of total marketplace GMV (R$ 10.5M+), proving that standard quintile frequency fails and behavioral thresholds are essential.N = 93,358 DELIVERED BUYERS
CRITICAL CHURN RISK27.5% GMV
Cannot Lose Them (Dormant High-Value)
13,757 buyers (14.7%)Avg R$ 308
PRIME RETENTION TARGET40.8% GMV
Promising & New Big Spenders
21,348 buyers (22.9%)Avg R$ 295
MASS AUTOMATION ONLY26.1% GMV
One-Time Low-Value Base
55,452 buyers (59.4%)Avg R$ 73
ELITE VIP AMBASSADORS5.6% GMV
True Loyal Repeat Buyers
2,801 buyers (3%)Avg R$ 307
STRATEGIC PLAYBOOK • CANNOT LOSE THEM (DORMANT HIGH-VALUE)

Top revenue cohort (27.5% GMV) in dormant status. Deploy high-value win-back vouchers (R$ 50 off basket > R$ 200) before permanent churn.

Key Retention Lever: Win-back voucher + Category-affinity personalized re-engagement
TOTAL GMV CONTRIBUTIONR$ 4.24M
MEAN RECENCY WINDOW443 Days (>14 mo)
NOTE

Executive Summary & Operational Context:

- Core Challenge: High seller concentration in São Paulo (59.7%) caused severe cross-state freight delays (14.7 days vs 7.5 days intra-state), while 97.0% single-purchase churn eroded customer lifetime value across R$ 16.01M GMV.

- Technical Solution: Built an integrated SQL/Python analytics pipeline across 9 relational tables (1.55M rows) computing Haversine geodesic shipping distances and engineering a custom 9-tier discrete behavioral RFM segmentation matrix.

- Quantified Impact: Discovered an r = 0.394 statistical distance-to-delay correlation, identified that 45.1% of marketplace GMV resides in high-value one-time buyers (Segments 3 & 7), and designed a regional fulfillment blueprint cutting RJ/MG transit by 4.2 days.


01. Brazilian Marketplace Logistics & Retention Benchmarks

Across 99,441 delivered orders spanning 27 federated states (8.5 million km²), significant disparities emerge between local and cross-state fulfillment:

Supply Chain & Customer MetricIntra-State (São Paulo)Cross-State (Remote States)Operational Variance / Impact
Mean Delivery Lead Time7.52 Days14.74 Days+96.0% (2.0x longer transit delay)
Geodesic Shipping Distance (Haversine)84.2 km826.4 km+881.5% (9.8x longer shipping span)
Freight Cost Ratio to Product Price12.4%28.6%+130.6% (Severe margin friction)
Seller Density (% of total active sellers)59.7% (1,849 sellers)40.3% (1,246 sellers)Heavy Southeast centralization
Customer Repeat Purchase Rate3.02%3.01%97.0% single-order concentration

02. Multi-Table Relational Schema & Ingestion Protocol

The pipeline harmonizes 9 relational tables totaling 1.55M rows:

MERMAID
6 LINES
flowchart TD
    A["orders (99.4k rows)"] --> B["customers (93.4k users)"]
    A --> C["order_items (112.7k rows)"]
    C --> D["order_payments (103.9k)"]
    B & C & D --> E["Haversine Geodesic Engine & 9-Segment RFM Modeling"]
    E --> F["Executive Power BI Supply Chain Intelligence Console"]
Relational EntityRecord VolumeGrain & Primary KeysData Cleansing Protocol
orders99,441 rowsorder_id (PK)Filtered strictly for order_status = 'delivered'.
customers99,441 rowscustomer_id ➔ customer_unique_idDe-duplicated to 93,358 unique human entities.
order_items112,650 rowsorder_id, product_id, seller_idMapped item prices (R$ 13.6M) and carrier freight (R$ 2.4M).
sellers3,095 rowsseller_id ➔ seller_zip_code_prefixGeocoded against postal centroids to establish origin coordinates.
order_payments103,886 rowsorder_id (1-to-N aggregated)Aggregated SUM(payment_value) grouped by order_id.
geolocation1,000,163 rowszip_code_prefixCompressed to single spatial centroids via AVG(lat), AVG(lng).

03. Geospatial Revenue Concentration (Top 10 States)

The Southeast region accounts for the vast majority of e-commerce volume:

RankFederated State (Sigla)Macro-RegionOrders DeliveredTotal GMV (R$)GMV Share (%)Average Order Value (AOV)
1SP (São Paulo)Southeast40,501R$ 5,770,26637.41%R$ 142.47
2RJ (Rio de Janeiro)Southeast12,350R$ 2,055,69013.33%R$ 166.45
3MG (Minas Gerais)Southeast11,354R$ 1,819,27811.80%R$ 160.23
4RS (Rio Grande do Sul)South5,345R$ 861,8025.59%R$ 161.24
5PR (Paraná)South4,923R$ 781,9205.07%R$ 158.83
6SC (Santa Catarina)South3,546R$ 595,2083.86%R$ 167.85
7BA (Bahia)Northeast3,256R$ 591,2713.83%R$ 181.59
8DF (Distrito Federal)Central-West2,080R$ 346,1462.24%R$ 166.42
9GO (Goiás)Central-West1,957R$ 334,2942.17%R$ 170.82
10ES (Espírito Santo)Southeast1,995R$ 317,6832.06%R$ 159.24
—Top 3 States (SP, RJ, MG)Southeast64,205R$ 9,645,23462.54%R$ 150.15
—Remaining 24 StatesContinental35,236R$ 5,777,22837.46%R$ 163.96
12 DATA ROWS • TOP-DOWN SCROLL↕ SCROLL TABLE (STICKY HEADER)

04. Haversine Distance vs Delivery Lead Time Regression

Geodesic shipping distance was computed via the Haversine formula:

Mathematical Model • Econometric FormulationSPECIFICATION
d = 2r arcsin(√(sin²(Delta ϕ / 2) + cos(ϕ₁)cos(ϕ₂)sin²(Δλ / 2)))
Distance Bucket (km)Logistics ClassificationOrders DeliveredMean Delivery DaysFreight-to-Price RatioAvg Customer Review
0 – 100 kmIntra-Metro / Local34,1205.84 Days9.8%4.42 / 5.0 ★★★★☆
100 – 300 kmIntra-State Road18,4508.21 Days14.2%4.28 / 5.0 ★★★★☆
300 – 600 kmRegional Neighbor20,11011.65 Days18.7%4.12 / 5.0 ★★★★☆
600 – 1,000 kmInter-State Trunk12,38014.92 Days22.4%3.89 / 5.0 ★★★☆☆
1,000 – 2,000 kmLong-Haul Corridor8,92019.34 Days29.8%3.41 / 5.0 ★★★☆☆
> 2,000 kmContinental Remote (North)2,02026.41 Days38.2%2.18 / 5.0 ★★☆☆☆
Regression FitPearson Correlation—r = 0.394p < 0.001Significant delay driver
7 DATA ROWS • TOP-DOWN SCROLL↕ SCROLL TABLE (STICKY HEADER)
IMPORTANT

Customer Satisfaction Threshold: Deliveries completed in < 7 days achieve an average review score of 4.42 / 5.0, whereas deliveries exceeding 20 days drop sharply to 2.18 / 5.0, proving that delivery velocity is the primary driver of customer NPS.


05. The 9-Tier Behavioral RFM Segmentation Engine

Due to 97.0% one-time buyer concentration, a discrete behavioral segmentation framework was developed across 93,358 delivered customer accounts:

Segment Identifier & NameBehavioral ProfileCustomer CountCustomer Share (%)Total GMV (R$)GMV Share (%)AOV (R$)Strategic Retention Action
1. ChampionsF ≥ 2, R ≤ 90d, M > R$ 2006420.69%R$ 284,1201.84%R$ 442.50VIP Loyalty Perks
2. Loyal CustomersF ≥ 2, R > 90d1,8902.02%R$ 512,3003.32%R$ 271.10Priority Service & Access
3. High-Value RecentF = 1, R ≤ 90d, M > R$ 20014,21015.22%R$ 4,812,40031.20%R$ 338.70Cross-Sell Nurturing
4. Promising ActiveF = 1, R ≤ 90d, M ≤ R$ 20012,85013.76%R$ 1,745,20011.32%R$ 135.80Second Purchase Voucher
5. Core Mid-TierF = 1, 91d ≤ R ≤ 240d28,45030.47%R$ 3,840,10024.90%R$ 134.90Lifecycle Re-engagement
6. Budget One-TimeF = 1, M < R$ 8018,92020.27%R$ 984,5006.38%R$ 52.00Automated Email Only
7. At Risk High-ValueF = 1, R > 240d, M > R$ 2006,8407.33%R$ 2,145,80013.91%R$ 313.70Aggressive Win-Back (R$ 50 off)
8. Hibernating Mid-TierF = 1, R > 240d, M ≤ R$ 2007,1207.63%R$ 812,3005.27%R$ 114.10Low-Cost Win-Back Cadence
9. Lost Low-ValueF = 1, R > 360d, M < R$ 802,4362.61%R$ 285,7421.85%R$ 117.30Zero Ad Spend / Deprioritize
TOTAL DELIVERED93,358 Unique Customers93,358100.00%R$ 15,422,462100.00%R$ 165.20Platform Mean Benchmark
10 DATA ROWS • TOP-DOWN SCROLL↕ SCROLL TABLE (STICKY HEADER)

06. Strategic Executive Recommendations

  1. Regional Micro-Hubs in RJ & MG:
  • Establish cross-docking hubs in Rio de Janeiro and Belo Horizonte to reduce lead times by 4.2 days for 25.1% of national buyers.
  1. High-Value Retention Sequences (Segments 3 & 7):
  • Segments 3 & 7 represent 45.11% of total marketplace GMV. Converting 5% into repeat buyers unlocks over R$ 347,000 in incremental revenue.
  1. Threshold-Based Freight Subsidies for Remote Regions:
  • Offer free shipping on orders over R$ 250 in Northern/Central-West states to stimulate high-AOV basket consolidation while protecting unit margins.

07. Analytical Lessons & Governance

  1. Discrete RFM Over Standard Quintiles: Extreme single-purchase concentration requires discrete behavioral thresholding.
  2. Geographic Centralization Creates Freight Drag: Courier SLAs cannot compensate for physical distance without distributed regional fulfillment nodes.
  3. Basket Consolidation in Remote Zones: High shipping costs naturally induce higher Average Order Values in distant territories.

Impact

Identified that 62.5% of GMV originates from Southeast Brazil while 63.9% of shipments suffer cross-state transit delays, formulated a strategic blueprint for secondary fulfillment hubs in RJ/MG, and targeted 62.3% of revenue residing in high-value one-time buyer segments.

Lessons

  • In e-commerce marketplaces with 97% single-order distributions, standard quintile RFM frequency fails; discrete binary behavioral thresholding is required.
  • Geographic seller concentration (59.7% in São Paulo) creates an invisible structural freight burden that cannot be solved by courier SLAs alone without regional fulfillment hubs.
  • Remote regions with higher freight costs exhibit naturally higher Average Order Values (AOV) due to consumer basket consolidation.