Business question: Are late deliveries associated with lower review scores, and how does lateness vary by state and over time?
The page has two parts: how I did the analysis, following the six-step data analysis process from the Google Data Analytics course, and what I would tell a manager, as a short memo with the problem and the next steps.
Data analysis process
- AskSet the business question
- PreparePublic Olist data from Kaggle, loaded into BigQuery
- ProcessOne row per order, checked in SQL and Python
- AnalyzeFive BigQuery SQL queries
- ShareTableau Public dashboard
- ActMemo with the problem and next steps
Step-by-step details: Ask to Act
Ask
- Are late orders rated lower than on-time orders, and by how much?
- How many days late does it take before customers leave a 1-star review?
- Which states have the highest late-delivery rates?
- When did lateness rise over time?
Prepare
- Data: the public Brazilian E-Commerce Public Dataset by Olist on Kaggle: orders, customers and reviews, Sep 2016 – Aug 2018.
- Storage: the tables were loaded into BigQuery.
- Scope: only delivered orders (96,470), because a late flag needs a delivery date.
Process
- Build one row per order. Reviews are aggregated per order before the join, so orders with several reviews don’t get duplicated. A left join keeps delivered orders without a review.
- Define lateness consistently. An order is late when it was delivered after the estimated date;
days_lateis floored at zero for early deliveries. - Validate. 96,470 rows and 96,470 distinct orders (0 duplicates), 0 missing order dates, and 646 orders without a review (0.67%). The late rate matches in BigQuery, Python and Tableau.
Analyze
SQL used: share of total with SUM(COUNT(*)) OVER (), 1-star and 5-star shares with COUNTIF, an approximate median with APPROX_QUANTILES, days-late buckets with CASE, a state ranking with RANK() (states with fewer than 100 orders excluded), and a weighted 3-month rolling late rate.
| Delivery status | Orders | Avg score | Median | 1-star | 5-star |
|---|---|---|---|---|---|
| Late | 6,534 (6.77%) | 2.27 | 1 | 53.69% | 16.53% |
| On time/early | 89,936 (93.23%) | 4.29 | 5 | 6.58% | 62.21% |
| Days late | Orders | Avg score | 1-star share |
|---|---|---|---|
| On time/early | 89,936 | 4.29 | 6.58% |
| 1-3 days | 1,870 | 3.29 | 25.11% |
| 4-7 days | 1,802 | 2.11 | 58.47% |
| 8-14 days | 1,478 | 1.67 | 70.61% |
| 15+ days | 1,384 | 1.73 | 68.76% |
- The first week decides the rating. The 1-star share rises from 6.6% on time to 25% at 1-3 days late and 58% at 4-7 days, then plateaus at about 70%.
- States: among states with at least 100 delivered orders, AL (21.41%), MA (17.43%) and SE (15.22%) have the highest late-delivery rates.
- Over time: lateness held at about 3-4% through most of 2017, rose in November-December 2017 and February-March 2018 (up to 18.96% in a single month), and the weighted 3-month rate peaked at 12.88% in March 2018 before returning to about 3.6%.
Share
Open the interactive dashboard on Tableau Public →
Act
The findings become a short memo for a manager: the problem in one line, three numbers, and three next steps. It’s in part 2 below.
Key findings and next steps
A manager doesn’t need every number on the dashboard. They need to know what the problem is and what to do next, so this is the email I would send.
Subject: Late deliveries are linked to our 1-star reviews. Look at the 4+ day delays first.
The problem: late deliveries go together with much lower ratings. Only 6.8% of orders arrive late, but more than half of those (54%) get a 1-star review, compared with 7% of on-time orders.
The point that matters: customers forgive a short delay. At 1-3 days late, 25% leave 1 star. From 4-7 days late, that jumps to 58%, and after that it stays near 70%. The real damage starts at about 4 days late.
Where it happens most: the states of AL, MA and SE have the highest late rates (AL: 21%, three times the average).
What we should do next:
- Test 4 days late as an alert line. Flag every order that reaches 3 days late and act before day 4, for example by contacting the customer, then check whether ratings for those orders improve.
- Start with AL, MA and SE. Review the carriers and delivery estimates there first, because those states have the highest late-delivery rates. Check their late-order counts too before deciding where to spend effort.
- Watch the late rate monthly. The 3-month rolling late rate peaked at 12.9% in March 2018, so a monthly check catches the next spike early.
Limitations
- The results show an association, not proof that late delivery caused the lower ratings.
- Only delivered orders are included, so the latest months may understate lateness (orders still undelivered when the data was captured are missing).
- The monthly trend shows when lateness rose, not why.
Query files
- 01 · Build the analysis table
- 02 · Delivery status vs reviews
- 03 · Late rate by state
- 04 · Monthly trend
- 05 · Data-quality validation
Tools
BigQuery (GoogleSQL) · Tableau Public · Python (pandas, Matplotlib)
