using Python.

Managing a complex international distribution network is no easy task, but with the right tools and strategies, you can improve logistic performance and streamline operations.
How data analytics can help you monitor and optimize your supply chain using operational indicators?
From measuring performance to identifying areas for improvement, let us see how to take your logistic performance management to the next level.
The performance of your network can be summarised in one sentence
Are you delivering your end customers on time in full?
Behind this simple question is a set of complex KPIs needed to monitor and understand your performance.
As a data scientist, how can you implement an automated monitoring of these KPIs using Python?
In the following sections, we will try to understand the methodology required to monitor the performance of complex logistic operations using Data Analytics.
SUMMARY
I. Example of a Simple Supply Chain Network
Production and delivery of garments for a fashion retailer
II. End-to-End Lead Times
Lead time between the order creation and the store delivery
1. Information flow
Each step of the process is tracked by different systems
2. End-to-End Visibility
Record time stamps from order creation to shipment delivery
3. KPIs and Lead times
Actual versus targets lead times
IV. Conclusion
1. Failure Analysis using Process Mining with Python
Automatically detect issues in your distribution chain
2. Improve reporting with additional indicators
Measure container loading efficiency and CO2 emissions
3. Generative AI: User Interface boosted by GPT
Connect your solution to a GPT agent that can answer questions
4. Root Cause Analysis
What can go wrong?
The Supply Chain Network of a Fashion Retailer
Scenario
You are a data scientist in an international clothing group with stores worldwide.
Stores are delivered from local warehouses and directly replenished by factories.
A logistic performance manager requested your support.
How can we use data analytics to measure the performance of our operations?
Stores Replenishment
Distribution planners manage the inventory in the stores to meet demand.

When the inventory level, for a specific reference, reaches the minimum level
- The distribution planner creates a store replenishment order in the ERP ** with the quantity for each item and a requested delivery date**.
- The order is transmitted to the Warehouse Management System
- Warehouse operational teams prepare the orders for shipment
- Transportation teams organise the pick-up at the warehouse
- Shipments are delivered and received at the stores
💡 In our example, stores replenishment are managed by a team of distribution planners. But it can be also completely automated using ERP or inventory management systems.
If you want to learn more about inventory management policies, have a look at the article below
Inventory Management for Retail – Periodic Review Policy
How do we define the performance?
Overall Performance: On Time In Full (OTIF)
The overall process performance can be measured by the network’s capacity to deliver the stores on time and with the right quantity of items (in full).

As a logistic performance manager, her focus will be on improving this indicator that drives the satisfaction of your internal customers (i.e., the stores).
💡 For more information about the KPI On Time In Full have a look at this short explainer video in my youtube channel: Link to Youtube
End-to-End Analysis
However, more than this indicator is needed to give you complete visibility of what is happening in the chain.
When and why has this store been replenished late?
Therefore, we must use data analytics to break it down and understand what impacts overall performance.
End-to-End Lead Times: Understanding the Process
Let us break down the different steps between order creation and shipment delivery.
Supply Chain Systems Exchanging Information
In supply chain analytics, everything starts with understanding the flow of information.
By connecting to the suitable systems, you will extract and process the correct information.

Which insights can we get from these transactional data?
Scenario: Store ReplenishmentThe inventory levels of some references are below the minimum safety level in several stores.
- A distribution planner creates a replenishment order in the ERP.
- The order is transmitted to the WMS before the expected picking date
- Warehouse operational teams prepare and pack the orders
- A truck is assigned for pick-up at the warehouse
- Shipment information is transmitted to the TMS for tracking
- The goods are delivered to the store
- Items are received in the ERP **** by store teams
💡 In a perfect world, we will assume that these systems are perfectly connected using API/EDI to ensure a continuous traceability of the flow.
How can we track shipments along the distribution chain?
End-to-End Visibility: Tracking Lead Times
After connecting the different systems, you can see each step between replenishment order creation and store delivery.

- Order reception time: timestamp when the order is received in the WMS and ready to be prepared in the warehouse
- Warehouse Operations: picking, packing and shipping are tracked by the WMS
- Transportation: tracking of the orders from shipping to delivery
- Store receiving: timestamp when store teams are receiving the shipments in the ERP
During the order creation, planners add a requested delivery date that can be used to calculate the targeted timing for each process.

Thus, we can know at each step if operations are behind schedule and find potential bottlenecks.
💡 Time stamps are estimated considering the requested delivery date. We use the target leadtimes of each step from creation to delivery to estimate the time stamps.
What are the performance indicators to follow?
KPIs and Lead Times: Measuring Performance
From an operational point of view, there is no point in looking only at the OTIF at delivery.

The segmentation by sub-process is mandatory to monitor the performance of each leg of the logistic network:
- Order transfer is impacted by infrastructure & software
- Order preparation is linked with the capacity and productivity of warehouse operations
- Pick-up scheduling lead time between the end of packing and shipping time
- Transportation from the warehouse to the store
💡 The added value at this stage is to provide detailed visibility of the performance by process. Your role is to support operational teams to improve their performance by implementing a continuous improvement culture backed by data.
Conclusion
This exercise requires a combination of operational indicators and data analytics tools that provide end-to-end visibility and actionable insights.
Can we automate failure analysis?
Process Mining with Python
Process mining for Logistics management is a type of data analytics that focuses on discovering, monitoring and improving operational processes.
It involves analyzing data from various sources, such as process logs, to
- understand how a process is being executed
- identify bottlenecks and inefficiencies
- suggest ways to improve the performance
As a data scientist, how can you use it to detect failure in the distribution chain?
The graph below shows an example of lead times plots (in minutes) that provide an overview of performance variability of order transmission, pick and pack and warehouse-airport transfer.

For instance, the visual above will help you spot late deliveries and quickly monitor each leg of the chain to understand how they impact lead times.
For more information about process mining, check this article
We found the root cause, what’s next?
Simulation of Mitigation Plans with Digital Twins
Reaching this step is already challenging.
The logistic teams need to work on mitigation plans to ensure these issues will not occur.
They will probably request your support to simulate the impact of these solutions on the overall performance and costs.
Let’s simulate initiatives with "what if" scenarios using a digital twin.
A digital twin is a digital replica of a physical object or system.
A Supply Chain digital twin is a model representing components and processes involved in the supply chain.

After you find the root causes of delays and incidents, continuous improvement teams may design and implement solutions or mitigation plans.

A digital twin can be used to simulate the impact of these solutions on the overall performance.
- Build a model M0 to replicate the current operations with the actual operational issues.
- Simulate these mitigation plans in your model (increase warehouse capacity, reduce transportation lead time, etc.)
- Estimate the impact on the percentage of late deliveries
Try it yourself! Have a look at this case study 👇
What is a Supply Chain Digital Twin?
Beyond lead times, what can we measure?
Sustainability & Operational Indicators
Enrich your reporting solution with advanced indicators tailored to specific processes or goals.
For instance, you have been contacted by the finance teams that complain about sea freight costs.

According to the transportation team, this may be due to the filling rate of containers.
Can we assess the loading efficiency of sea freight containers?

In the article linked below, discover a method to assess and improve loading efficiency that can inspire a new performance indicator.
This is still related to efficiency and costs.
How can you support the sustainable transformation of your company with reporting?
You probably heard about ESG scoring.
As investor’s demand for transparency in sustainable development has grown, you need to reflect that trend in your reporting.

Using emissions factors, you can automatically measure the emissions of each order using shipment weight and distance.

For instance, the visual above shows the emissions per delivery country splitter by product code.
Do you want to implement sustainability reporting?
Look at this article for more details👇
Supply Chain Sustainability Reporting with Python
User: Can you please replace OTIF @ delivery with OTIF @ Shipment?
Imagine a smart tool that would adapt the indicator to the user.
It’s possible.
Have you heard about Generative AI?
Generative AI: User Interface boosted by GPT
After OpenAI released the first version of ChatGPT in November 2022, Generative AI became a trending technology applied in many industries.
These tools can boost the user experience for the specific application of Supply Chain Resilience by creating intelligent agents boosted by large language models.
![Supply Chain Control Tower Agent with LangChain SQL Agent [Article Link] - (Image by Author)](https://towardsdatascience.com/wp-content/uploads/2022/07/056lIIS9mbpVgvlfn.png)
My first experiment was the creation of a LangChain agent connected to a database that would answer specific questions:
- How many shipments were delayed the first week of May?
- Could you explain why?
Can I ask GPT to explain the poor logistic performance of last week?
The idea was to equip a GPT-powered agent with access to a TMS database so that it could create SQL queries to extract information from data automatically.

The results are impressive; users can interact directly and get their answers in seconds.

This kind of solution can also be packaged in GPTs, a new feature allowing users to create custom versions of ChatGPT tailored for specific purposes.

In another article, I share my explorative journey of deploying a GPT to automate ABC Analysis and Pareto chart plot.
You try this solution and have a look at the articles for more details,
Create GPTs to Automate Supply Chain Analytics
Leveraging LLMs with LangChain for Supply Chain Analytics – A Control Tower Powered by GPT
Where should we focus our attention?
Focusing on critical metrics like on-time delivery and inventory turnover can help you identify areas for improvement and track progress toward your goals.
After measuring, we need to understand the reason for delays.
Identifying Root Causes
To improve overall performance, you must spot the root cause(s) of late deliveries.
What can go wrong in the process?
IT Infrastructure & SoftwareIt starts with the systems; you can face delays due to capacity issues or system failures.
If the WMS does not receive the order, your warehouse teams cannot proceed with preparation and shipment.

Warehouse OperationsIn the warehouse, the lead time can be impacted by
- Stock-out: products missing, causing back orders and cancellation
- Capacity: resources shortage to absorb the workload
- Transportation sourcing: no trucks to pick up packed orders

TransportationAfter the truck leaves the warehouse, the lead time can be impacted by
- Road conditions or delays during transfers for multi-modal transportation
- Postponement of delivery due to availability constraints: for instance, shortage of store staff to receive the goods, store closure, etc…

These are general examples that must be adapted to your specific situation.
If you prefer to watch, have a look at the video version of this article
About Me
Let’s connect on Linkedin and Twitter. I am a Supply Chain Engineer who uses data analytics to improve logistics operations and reduce costs.
For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.
If interested in Data Analytics and Supply Chain, look at my website.
💌 New articles straight in your inbox for free: Newsletter 📘 Your complete guide for Supply Chain Analytics: Analytics Cheat Sheet