Build a revenue dashboard.
A weekly-update dashboard the rest of the team will actually look at. Four SQL cells, four tiles, one filter, one published link.
What you'll build
A four-tile dashboard with weekly revenue, top customers, churn rate, and MRR by plan. We'll pin tiles directly from a notebook, arrange them on the grid, add a date-range filter that flows to every tile, and publish the result as a shareable link.
A PostgreSQL or warehouse connection with a subscriptions, invoices, and customers-shaped schema. If you don't have one, the SQL is small enough to adapt to the Chinook sample from Your first analysis.
1. Open a new notebook
From the project shelf, create a notebook called revenue.orchid. We'll write four SQL cells here, then pin them to a sibling dashboard. Set the integration on the notebook header so every new SQL cell defaults to your warehouse — see SQL cells for how default integrations work.
2. Cell one — weekly revenue
First tile: a single time-series of revenue per ISO week. Rename the cell variable to weekly_revenue — the dashboard will use that label.
SELECT
date_trunc('week', paid_at) AS week,
SUM(amount_cents) / 100.0 AS revenue
FROM invoices
WHERE status = 'paid'
AND paid_at >= now() - interval '12 weeks'
GROUP BY 1
ORDER BY 1;Run the cell. Orchid renders the result table and infers a sensible chart preview in the cell footer — a line chart, because the X axis is a date. Click Pin to dashboard on the cell's context menu. A dialog asks whether to pin to an existing dashboard or create a new one — choose New dashboard and name it Revenue.
3. Cells two through four
Add three more SQL cells, each named to match the tile you want.
Top customers — variable top_customers:
SELECT
c.name,
SUM(i.amount_cents) / 100.0 AS lifetime_revenue
FROM customers c
JOIN invoices i ON i.customer_id = c.id
WHERE i.status = 'paid'
GROUP BY c.name
ORDER BY lifetime_revenue DESC
LIMIT 10;Churn rate — variable churn_rate:
WITH active AS (
SELECT date_trunc('week', activated_at) AS wk, count(*) AS new_subs
FROM subscriptions
WHERE activated_at >= now() - interval '12 weeks'
GROUP BY 1
),
churned AS (
SELECT date_trunc('week', cancelled_at) AS wk, count(*) AS lost_subs
FROM subscriptions
WHERE cancelled_at >= now() - interval '12 weeks'
GROUP BY 1
)
SELECT
a.wk AS week,
ROUND(100.0 * COALESCE(c.lost_subs, 0) / NULLIF(a.new_subs, 0), 2) AS churn_pct
FROM active a
LEFT JOIN churned c ON c.wk = a.wk
ORDER BY a.wk;MRR by plan — variable mrr_by_plan:
SELECT
plan,
SUM(mrr_cents) / 100.0 AS mrr
FROM subscriptions
WHERE status = 'active'
GROUP BY plan
ORDER BY mrr DESC;Run each, then pin each to the same Revenue dashboard. Orchid stacks new tiles in the next available row.
4. Arrange the tiles
Open the Revenue dashboard (it appears in the file tree as revenue.orchid-dashboard). The grid is 12 columns wide. Drag tile corners to resize and tile bodies to move. A good first layout:
- Weekly revenue — full width (12 cols), top row
- Churn rate — half width (6 cols), second row left
- MRR by plan — half width (6 cols), second row right
- Top customers — full width (12 cols), third row
Each tile renders the same chart Orchid inferred in the notebook. Click the tile gear icon if you want to override the chart type — switch the churn tile to a bar chart, the MRR tile to a pie, and so on. Reference: Dashboard tiles.
5. Add a date-range filter
Click + Filter in the dashboard toolbar and pick Date range. Name it period and bind it to the cells whose queries reference time. Orchid rewrites the bound queries to use the filter value via a SQL parameter — your paid_at >= now() - interval '12 weeks' becomes paid_at >= :period_start at runtime.
See Dashboard filters for the full binding syntax. For now, the default presets (Last 7 days, Last 30 days, Last quarter) are enough.
6. Preview as a viewer
Hit Preview in the toolbar. Orchid renders the dashboard the way a viewer would see it — no edit controls, no cell internals, just the tiles and the filter bar. Change the date range a few times and watch the tiles refresh.
7. Publish
Click Publish. The first time, Orchid asks for a visibility mode — pick Team if you want only teammates with a sign-in to view, or Link-only if anyone with the URL should see it. Confirm. Orchid pushes the dashboard to the cloud and returns a URL of the form https://<slug>.orchidide.com.
$ open https://revenue.orchidide.comPublished dashboards are read-only by design. Edits happen locally; publishing again updates the cloud copy. See Dashboard sharing for the publish model.
Where to go next
- Building dashboards — beyond the basics: tabs, sections, conditional formatting.
- Filters — multi-select, cross-tile bindings, parameterized SQL.
- Sharing — visibility modes, embeds, refresh schedules.
- Publish a share link — the publish flow in detail, including how non-Orchid colleagues view the result.