Skip to content
Not released yet: version 0.1 is being built. See what works today.

Report interactions

A report in Metrics Book is an anfra Data App: an HTML page under semantic/apps/ that asks anfra for metrics by name. To make a report do more, start from the interaction gallery that anfra, from Holistics, publishes.

58 interaction patterns in 9 groups, plus a “Top picked” group of the 7 that readers reach for most:

  • Dates and time: pick the period, its detail and what to compare it with.
  • Selections: click or drag on one chart to filter the others.
  • Filters: decide which rows count.
  • Tables and calculations: top N, percent of total, running totals and the like.
  • Drilling: go from a number to the detail behind it.
  • Scenarios and analyses: what-if parameters, trend lines, cohorts.
  • Controls: decide what each control and click changes.
  • Save and share: bookmarks, saved views, undo.
  • Annotation: notes, targets and flags, all marked as proposed.

Each pattern shows the interaction working, and its “Copy magic” button copies a prompt that adds the pattern to your own Data App.

  1. Pick the pattern for the question the report should answer. “Drill down” shows which days made a spike; “What-if parameter” tests a price change before you make it.
  2. Copy its prompt with “Copy magic”, and give it to your agent with the report, for example semantic/apps/executive/flash.html.
  3. The agent adds the interaction through anfra’s SDK. The report still asks for metrics by name, so every number keeps its one definition.
  4. Run mb check. It compiles every query in every report with anfra, so a broken one fails before anyone reviews it. Then review the change in a pull request like any other.

The template’s eight reports start with the patterns most reports need:

Pattern Reports
Date filter, with month, year and year-to-date presets all eight
Period comparison, against the year before all eight
Filter mapping: one date control, mapped to each query’s own date field all eight
A second range filter, on the customer’s first-order month Acquisition, Retention
Top N, sorted by net sales or spend Acquisition, Merchandising

None of them uses cross-filtering, drill down, a what-if parameter or view underlying data yet. Those are good first patterns to add.

The gallery is anfra’s work and publishes no licence, so Metrics Book links to it and does not copy its prompts.