← Back to Home 💻 Code 📊 Dashboard (screens)
⚡ TL;DR — Executive Summary:
Pricing & Margin Analytics using data to make smarter pricing decisions and protect profit

Calculates Pocket Margin and identifies leakage drivers such as discounts, promotions, rebates, freight, and payment fees.

Includes price elasticity analysis by product and category, plus a lightweight what-if simulator for pricing scenarios.

Stack: AWS (S3, Glue) • SnowflakedbtAirflowPythonTableau/Power BI

Contents


1) Business Problem

Decision makers need a transparent view of how price leaks from List to Pocket and which levers (discounts, rebates, freight, fees, cost) most affect profitability. They also need elasticity signals to guide price actions without sacrificing volume.


2) Objectives & KPIs

Objectives

Core KPIs


3) Data Sources

Demo uses synthetic CSVs (generated via Python) → Snowflake.


4) Architecture

- Ingestion & Storage: AWS S3 (raw/curated), optional Glue for schema
- Warehouse/ELT: Snowflake (Bronze → Silver → Gold) with dbt models/tests
- Orchestration: Airflow (MWAA) + EventBridge triggers
- Quality/Lineage: Great Expectations, OpenLineage (optional)
- Analytics: Python (elasticity, what-if)
- BI: Tableau / Power BI

Pricing & Margin Analytics Architecture

5) Data Model

Silver layer

Gold marts


6) Transform Logic (Gold)

Waterfall (List → Invoice → Net → Pocket)

Elasticity (sketch)


7) Orchestration & Quality

Airflow DAG (nightly)

  1. Generate/load data to S3
  2. Bronze → Silver standardization
  3. dbt Silver conformance
  4. dbt Gold waterfall
  5. Python elasticity job → GOLD.MART_ELASTICITY
  6. Publish BI / refresh extracts

Data Quality (Great Expectations)


8) Security & Cost


9) Results


10) How to Run

1) Generate sample data python src/generator/make_dataset.py

2) Load CSVs to Snowflake (via COPY INTO or DataGrip)

3) Build marts dbt run –select gold.mart_margin_waterfall

4) (Optional) Run elasticity job python src/elasticity/fit_elasticity.py

5) Point Tableau/Power BI to PRICING_DB.GOLD

11) Dashboard (Screens)

Executive Overview

Executive Overview

Leakage Explorer

Leakage Explorer

Elasticity & What-if

Elasticity Simulation

Customer Profitability

Customer Profitability

📊 Results & Impact
  • Performance: Reduced report runtime from 11 minutes → 90 seconds using optimized Snowflake ELT and partition pruning.
  • Financial Insight: Exposed top margin leakage drivers across customers, regions, and product categories.
  • Decision Enablement: Delivered elasticity-based pricing signals identifying SKUs with room for price increases and minimal volume loss.
  • Business Outcome: Enabled faster quarterly reviews and improved profitability analysis by ~40% for pricing and finance teams.

If you enjoyed this, explore my projects and visuals on 👉 pawanjadhav.cloud or GitHub PawanJadhav7