📊

Inventory Check

Compare two Excel files to find differences in inventory levels.

Excel ⭐⭐ Intermediate ⏱️ 5 minutes

😫 The Pain Point

You have yesterday’s stock count and today’s stock count in two Excel files. You need to find what changed: new items, removed items, quantity differences.

🚀 Agentic Solution

A Smart Diff Tool that compares datasets and highlights changes.

Key Features:

  • Match Key: Compare using SKU or Product ID.
  • Change Detection: Added, Removed, Modified rows.
  • Delta Calculation: Show quantity differences.

⚔️ Phase 1: Commander (Quick Fix)

For quick comparison.

Prompt:

“I have two Excel files: stock_yesterday.xlsx and stock_today.xlsx, both with columns ‘SKU’ and ‘Quantity’. Write a Python script using Pandas to:

  1. Compare: Find differences using SKU as key.
  2. Classify:
    • New: SKU exists only in today
    • Removed: SKU exists only in yesterday
    • Changed: Quantity difference
  3. Output: Save stock_diff.xlsx with Status and Delta columns.

Print summary counts.”

Result: Clear inventory change report.

🏗️ Phase 2: Architect (Permanent Tool)

For Warehouse Managers.

Engineering Prompt:

**Role:** Python GUI Developer (PyQt6 Specialist)
**Task:** Create "Excel Diff Tool" Desktop App

**Objective:** A comparison utility to highlight differences between two Excel datasets (e.g., Yesterday vs Today).

**Tech Stack:**
* Language: Python 3.10+
* GUI Library: PyQt6 (Cross-platform)
* Data Engine: Pandas
* Packaging: PyInstaller

**Functional Requirements:**
1.  **UI Layout (PyQt6):**
    *   **Inputs:** File Selectors for "Reference File" and "New File".
    *   **Config:** Dropdown to select "Key Column" (Unique ID/SKU).
    *   **Action:** "Compare" button.
    *   **View:** Summary of "Added", "Removed", "Changed" rows.

2.  **Core Logic:**
    *   Outer Join on Key Column.
    *   Detect changes in value columns.
    *   Export result with color-coded highlighting (using openpyxl/xlsxwriter).
    *   **Threading:** Comparison runs in background thread.

3.  **Deliverables:**
    *   `main.py`: Complete source code.
    *   `requirements.txt`: Dependencies.
    *   **Build Instructions:**
        *   Windows: `pyinstaller --onefile --noconsole main.py`
        *   macOS: `pyinstaller --windowed --noconsole main.py`

🧠 Prompt Decoding

  • Merge Types: Left, Right, Outer, Inner - control which records appear in diff.

🛠️ Instructions

  1. Copy Prompt → Specify files → Run.

Related Workflows

Explore other categories

📬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

📖 Free eBook Guide 📦 7 Ready-to-use Scripts 🔔 Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.