← Back to Descriptive Analytics

Reporting

Packaging the Analysis for People Who Will Act on It

Reporting is where analysis becomes communication. The numbers, charts, and comparisons from the previous steps are assembled into a structured artifact — a dashboard, a slide deck, or a written report — designed for a specific audience and a specific decision. A good report is not a data dump; it is concise, leads with the metrics that matter, and ends with a recommendation someone can act on.

Metrics, charts & comparisons converge into one report Key metrics Charts & trends Comparisons Report dashboard · deck · doc

Reporting consolidates the analysis into one artifact built for a specific audience and decision.

Know the Audience First

Anatomy of a Good Report

  1. Headline metrics (KPIs) at the top — the few numbers that define success.
  2. Trend and comparison visuals that give those numbers context.
  3. A short narrative: what happened, why, and what to do about it.
  4. Supporting detail for those who need to dig deeper, kept out of the main flow.

In Python — a summary table for the report

Python · pandas

import pandas as pd

# One consolidated summary table by region and category
summary = (orders.groupby(["region", "category"])
                 .agg(sales=("sales", "sum"),
                      profit=("profit", "sum"),
                      orders=("order_id", "nunique"))
                 .assign(margin=lambda d: (d["profit"] / d["sales"]).round(3))
                 .sort_values("sales", ascending=False)
                 .reset_index())

# Headline KPIs for the top of the report
kpis = {
    "total_sales": orders["sales"].sum(),
    "total_profit": orders["profit"].sum(),
    "overall_margin": orders["profit"].sum() / orders["sales"].sum(),
}

# Export the table for a dashboard or document
summary.to_html("report_summary.html", index=False)
print(kpis)

In SQL — a roll-up with subtotals

SQL

-- GROUPING SETS produces detail rows AND subtotals in one pass,
-- exactly what a report's summary table needs.
SELECT
  region,
  category,
  SUM(sales)  AS sales,
  SUM(profit) AS profit
FROM orders
GROUP BY GROUPING SETS (
  (region, category),   -- detail
  (region),             -- per-region subtotal
  ()                    -- grand total
)
ORDER BY region, category;

Tools Commonly Used

Best Practices

Example: The Retail Performance Report

For the retail dataset, the report might consist of:

← Back to Descriptive Analytics