top of page

To Calculate the On-time Delivery percentage of supply chain partner to ensure delivery of life saving medicines

Requirement

Introduction: To calculates on-time delivery percentages for Supply chain logistics partners, identifies partners with perfect records, and flags those requiring improvement. This analysis will help to identify underperforming logistics partners and recommend switching to a supply chain provider with a 100% success ratio to ensure timely delivery of critical medicines.

 

Requirements:

 

Load the table 'supply_chain_delivery'.

 

Critical Medicines Filter*: Extracts rows where the Category_Wise is Critical_Medicines.

Group Aggregation*:

** On_Time_Count: Counts deliveries with Delivery_Status as On-Time.

** Total_Shipments: Counts all shipments for each logistics partner.

** On_Time_Percentage: Calculates on-time delivery percentage as (On_Time_Count divided by Total_Shipments) and multiply by 100.

 

Final Output:* Show the Result with column name of ‘Category_Wise', ‘Logistics_Partner’, ‘On_Time_Count’, ‘Total_Shipments’, 'On_Time_Percentage’. perfect_partners_df: Partners with 100% on-time delivery. underperforming_partners_df: Partners with less than 100% on-time delivery.

 

Write the Pyspark code without syntax error.

 

Unity Catalog: supply_chain_delivery

Purgo AI Agentic Code

bottom of page