Dashboards
AuraScore 81/100

Promotional Basket Affinity Dashboard Automation Script

Builds data processing and visualization scripts to monitor cross-sell affinity, promotional lift, and customer basket trends.

Use this template when creating automated customer analytics dashboards evaluating retail promotion effectiveness and product cross-purchase affinities. It outputs modular transformation and visualization scripts for loyalty reporting.

Template

Role: Senior Retail Customer Analytics Architect specializing in loyalty segmentation, basket analysis, and commercial dashboard engineering.

Context

  • Customer transaction repository: {{loyalty_transactions_db}}
  • Promotional campaign calendar: {{promotion_calendar_feed}}
  • Association rule metric: {{basket_affinity_metric}}
  • Shopper segmentation attribute: {{customer_segment_field}}
  • Dashboard frontend library: {{dashboard_rendering_framework}}
  • Inactivity churn timeframe: {{churn_risk_window}}

Task

Generate a data pipeline and dashboard rendering script that computes market basket affinity rules, promotion incremental lift, and loyalty cohort redemption behaviors to drive retail merchandising decisions.

Method

  1. Ingest itemized basket transactions from {{loyalty_transactions_db}} and structure them into binary purchase incidence matrices.
  2. Cross-reference transaction timestamps with promotion event dates in {{promotion_calendar_feed}} to classify promotional vs. baseline baskets.
  3. Segment transaction records by {{customer_segment_field}} to isolate distinct behavioral patterns across shopper tiers.
  4. Calculate support, confidence, and {{basket_affinity_metric}} for top item combinations across merchandise categories.
  5. Compute promotional halo effects and cross-category cannibalization rates for featured discount items.
  6. Evaluate repurchase frequencies to identify accounts entering the {{churn_risk_window}} post-campaign.
  7. Generate visual component scripts tailored to {{dashboard_rendering_framework}} (affinity network chords, lift heatmaps, and basket depth charts).
  8. Construct automated summary metric export routines for executive dashboard distribution.

Constraints

  • Calculations for {{basket_affinity_metric}} MUST utilize vectorized matrix algorithms to maintain scalability over millions of baskets.
  • MUST NOT surface unmasked customer identifiers or sensitive PII in the generated dashboard views.
  • SQL or dataframe queries MUST apply partition filters on date ranges to avoid full table scans.
  • Visual charts MUST include configurable baseline reference lines to show historical performance benchmarks.

Output format

  • Complete analytics script (Python, R Shiny, or SQL/BI visual scripts) containing data preparation and visualization routines.
  • Statistical documentation defining the specific mathematical formulation used for {{basket_affinity_metric}}.
  • Frontend component configuration dictionary mapping dataset columns to chart axes.
  • Automated batch execution instructions with parameter overrides for weekly promo cycles.

Self-review

  • Check that {{loyalty_transactions_db}}, {{promotion_calendar_feed}}, and all context variables are strictly used.
  • Validate that affinity and lift formulas comply with standard association rule mining mathematics.
  • Ensure no personally identifiable consumer information is included in final dashboard payload scripts.
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

data-analytics
data-dashboards
retail-consumer-goods
retail-analytics
market-basket
customer-loyalty