DAZL Documentation | Data Analytics A-to-Z Processing Language


Contents

contribution

business analytics

slug: step-contribution

Contribution Analysis Step

Purpose

Analyzes how each segment contributed to change between time periods. Answers the executive question: "What drove the change?"

When to Use

  • Quarter-over-quarter revenue analysis
  • Understanding growth/decline drivers
  • Attribution reporting for executives
  • Identifying segments to investigate further
  • Period-to-period variance decomposition

How It Works

  1. Groups data by all dimensions except the compareBy dimension
  2. Within each group, identifies consecutive time periods
  3. Calculates the change (delta) between periods
  4. Attributes what % of total change each segment represents

Parameters

Required

  • compareBy (string) - The time dimension column name (e.g., "quarter", "month", "year")
  • measure (string) - Which measure to analyze (e.g., "revenue", "units")
  • metric (string) - Which metric of the measure (e.g., "sum", "mean")

Optional

  • output (string) - Output dataset name. Default: "contribution"

Input Requirements

  • Data must contain the compareBy column
  • Data should be pre-filtered to relevant time periods (use filter-step upstream)
  • Measure column must exist as {measure}.{metric} (e.g., "revenue.sum")

Output Columns

All original columns are preserved, plus:

  • transition - Period pair identifier (e.g., "Q1-2024_to_Q2-2024")
  • baseValue - Measure value in the first (base) period
  • compareValue - Measure value in the second (compare) period
  • contribution - Absolute change (compareValue - baseValue)
  • contributionPct - Percentage of total change this segment represents
  • growthRate - Percentage change from base ((contribution / baseValue) × 100)

Note: contributionPct is calculated within each level so that segments at the same aggregation level sum to 100%.

Example Output

category region level transition baseValue compareValue contribution contributionPct growthRate
Electronics West 2 Q1-2024_to_Q2-2024 50000 60000 10000 200.0 20.0
Books East 2 Q1-2024_to_Q2-2024 30000 28000 -2000 -40.0 -6.7
Clothing West 2 Q1-2024_to_Q2-2024 20000 22000 2000 40.0 10.0

Related Documentation

  • pareto step - Identify which segments matter most
  • index step - Analyze efficiency vs volume