top of page

Inventory Management with Expiry Risk category and Days-to-Expiry Analysis

Requirement

Introduction: Expiry-related analysis in inventory management involves categorizing products into different risk groups (High, Medium, Low) based on their expiry dates. This process helps in assessing the number of days remaining until a product expires, allowing businesses to prioritize inventory handling. By tracking and managing inventory in this way, businesses can reduce waste, optimize stock levels, and make informed decisions to minimize financial losses due to expired products.

 

Requirements:

 

Read the table 'purgo_playground.supply_chain_delivery'.

 

Calculate the ‘Days_count_For_Expiry' based on expiry date with current date. Categorize inventory based on expiry date in the column Expiry_Risk, when 'Days_Count_For_Expiry' is below zero day then 'Expired', when 'Days_Count_For_Expiry' is less than 90 days then 'High Risk', when 'Days_Count_For_Expiry' is less than 180 days then 'Low Risk', otherwise 'No Risk’.

 

Show the results of each medicine id, manufacture date, Expiry date, days count for expiry and expiry risk.

 

Write the Pyspark code without syntax error.

 

Unity Catalog: 'purgo_playground.supply_chain_delivery'

Purgo AI Agentic Code

bottom of page