Omnichannel Sell-Through Dashboard ETL and Refresh Script
Automates data extraction, transformation, and semantic refresh for retail omnichannel sell-through and markdown tracking dashboards.
Use this template when configuring data warehouse refresh routines and semantic data models for merchandising dashboards. It produces ready-to-run data pipeline scripts that compute sell-through, stock-to-sales ratios, and markdown velocities.
Role: Principal Retail Business Intelligence Engineer with 12+ years optimizing omnichannel reporting pipelines and merchandise analytics.
Context
- Point-of-sale transactional source: {{pos_data_source}}
- Central inventory balance table: {{inventory_warehouse_table}}
- Store aggregation hierarchy: {{store_hierarchy_level}}
- Markdown discount trigger percentage: {{markdown_threshold_pct}}
- BI platform target destination: {{target_dashboard_engine}}
- Automated orchestration cadence: {{reporting_cadence}}
Task
Develop an enterprise-grade data transformation and dashboard publishing script that ingests transactional POS feeds and current inventory snapshots, computes core retail velocity metrics, and refreshes the semantic reporting layer for merchandising teams.
Method
- Ingest incremental point-of-sale transactions from {{pos_data_source}} and reconcile channel returns across digital and physical storefronts.
- Join real-time inventory balances from {{inventory_warehouse_table}} partitioned by the specified {{store_hierarchy_level}}.
- Compute net sell-through rate percentages by dividing net units sold by the sum of beginning stock and incoming transfers.
- Calculate stock-to-sales ratios and segment SKU performance into velocity quartiles.
- Apply conditional logic for products exceeding {{markdown_threshold_pct}} to flag margin compression risks.
- Format dimensional tables and aggregate metric views tailored for rapid query execution in {{target_dashboard_engine}}.
- Implement data quality assertion tests to identify and quarantine negative stock anomalies before pushing downstream.
- Embed schedule management and dashboard cache invalidation triggers aligned with {{reporting_cadence}}.
Constraints
- MUST execute idempotent incremental loads to prevent record duplication during execution retries.
- MUST NOT hardcode database credentials or connection URIs; use environment variables and key vault references.
- Schema output MUST enforce standard two-decimal precision on currency values and sell-through percentages.
- Inline error handling MUST log failed records to a dead-letter table without halting pipeline execution.
Output format
- Complete production script (Python with PySpark or SQL/dbt model files) with explicit variable bindings.
- Data dictionary specifying calculated metric formulas and partition keys.
- Logging and alerting configuration module for automated run failure notices.
- Performance tuning recommendations for memory allocation and dashboard query optimization.
Self-review
- Confirm that {{pos_data_source}}, {{inventory_warehouse_table}}, and all other context variables are correctly parameterized.
- Verify that sell-through calculations accurately account for customer returns and reserve units.
- Check that the output format strictly provides production-grade script logic rather than conceptual pseudocode.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.