SQL (SQLite), Python (pandas, scipy)
The Cost of a Late Package: Olist Delivery Analysis
Using 99,441 real orders from Olist, the largest department store on Brazilian marketplaces, I measured how late deliveries affect customer reviews and traced where the delays come from. Late orders were only 6.8% of volume but were tied to 27.6% of all 1 and 2 star reviews.
- At a glance: tool
- SQL (SQLite), Python (pandas, scipy)
- Dataset size
- 27.6% of low reviews tied to just 6.8% of orders
- More likely to get a 1-2 star review when late
- Of low reviews tied to just 6.8% of orders
- Of sellers caused half of all late orders

Problem
Olist, the largest department store on Brazilian marketplaces, shows every customer an estimated delivery date at checkout. I wanted to know how much missing that promise costs in customer satisfaction, and whether late deliveries are a system-wide problem or concentrated in specific sellers and shipping routes.
Approach
Data: 99,441 real anonymized Olist orders (2016 to 2018) across 8 related tables: orders, items, customers, sellers, products, reviews, payments, and category translations. 1. Loaded the raw CSVs into a SQLite database with Python and ran data quality checks before any analysis (duplicate reviews, multi-seller orders, missing dates and categories). 2. Built one clean order-level view in SQL using CTEs, joins, and window functions. 3. Wrote 9 SQL queries covering delivery KPIs, monthly trends, review scores by days late, shipping routes, seller concentration, estimate accuracy, and product categories. 4. Used Python (scipy) to test whether the link between lateness and reviews is statistically significant, then estimated its business impact.
Key Technical Challenges & How I Solved Them
Challenge
Duplicate reviews
Solution
547 orders had more than one review. I used ROW_NUMBER() partitioned by order to keep only the most recent review, so no order was counted twice.
Challenge
Orders split across sellers
Solution
1,278 orders included items from multiple sellers, which would double count them. I limited seller and route analysis to single-seller orders so each order maps to one seller and one route.
Challenge
Choosing the right statistical test
Solution
Star ratings are ordinal, so a t-test would be misleading. I used chi-square with Cramer's V for effect size, Mann-Whitney U, and Spearman correlation instead, all significant at p < 0.001.
Code Behind the Analysis
Results
Late delivery is the clearest driver of bad reviews. On-time orders got a 1 or 2 star review 9.3% of the time. Late orders did 62.4% of the time, 6.7 times more likely (chi-square p < 0.001, Cramer's V 0.40). Every extra day late makes it worse. Average review score fell from 4.29 on time to 3.29 at 1 to 3 days late, 2.10 at 4 to 7 days, and 1.70 at 8+ days. Only 6.8% of orders arrived late, yet they are associated with roughly 3,400 extra low reviews, 27.6% of all 1 and 2 star reviews. The problem is concentrated. Just 98 of 2,948 sellers (3.3%) account for half of all late orders. By route, Sao Paulo to Rio de Janeiro missed the promise 14.3% of the time across 8,048 orders, and Sao Paulo to Maranhao 19.1%. Estimates are padded, but unevenly. 74% of orders arrived 8 or more days early, while the routes above were still late. Late rates also spiked to 12.4% in November 2017 (Black Friday month) and 19.0% in March 2018. Not every low review is about delivery. Office furniture had the lowest score (3.64) and still scored only 3.76 when delivered on time, pointing to a product issue instead. 1. Set delivery estimates by route instead of using one blanket buffer. Tighten estimates on routes that arrive weeks early and add time to Sao Paulo to North/Northeast lanes and Sao Paulo to Rio. 2. Start a delivery performance program with the 98 sellers behind half of all late orders. 3. Notify customers as soon as an order is going to be late. Scores drop sharply after day 3, so early communication matters most. 4. Plan carrier capacity ahead of peak periods like Black Friday. Note: the data covers 2016 to 2018, and the review impact is an association, not proof of cause.
Code
SQL queries and Python analysis script
github.com/pavleristic2001/olist-delivery-analysis