Logo Light

How to Build a Sales Leaderboard That Ranks Itself

Aug 25, 2026

c
If you've ever tallied monthly sales per employee by hand, you know the drill — filter the spreadsheet by name, sum a column, write the number down, repeat for every person on the team. Do this every week, and it's only a matter of time before one number gets copied wrong or one person gets left out entirely.

In this tutorial, we'll build a Sales Leaderboard — a system where every employee's total sales updates itself the moment a new sale is logged, and a chart ranks the team automatically. No filtering, no manual sums, no monthly scramble.

Why this matters

A pile of individual sale records doesn't tell you who's performing well — it just sits there as data. The moment you can see it aggregated and ranked, it becomes a decision-making tool instead of a spreadsheet.


The Schema

Here's what we're working with — an Employee table holding names, and a Sales table linked to Employee through a One-to-Many relationship, with an Amount (Currency) and Date field for each sale.

EmployeeSales
Employee table showing the One-to-Many link between themEmployee table showing the One-to-Many link between themSales table showing the One-to-Many link between themSales table showing the One-to-Many link between them

One employee, many sales — a natural fit for this kind of relationship.


Step 1: Add Your Employees and Sales

Add a few employees, then log several sales for each, linking every sale back to the employee who made it.

Employee table populated with Amara Whitfield, Liam Brooks, and Priya NairEmployee table populated with Amara Whitfield, Liam Brooks, and Priya Nair

Sales table showing multiple sale records linked to each employee with amounts and datesSales table showing multiple sale records linked to each employee with amounts and dates

For this walkthrough, assume the following sales for the month:

  • Amara Whitfield — $2,400, $1,850, and $3,100
  • Liam Brooks — $900 and $1,200
  • Priya Nair — $4,500 and $2,750

Right now, each of these is just an isolated row. There's no single number anywhere that says "this is how much Amara sold this month."


Step 2: Aggregate Sales with Custom Logic

Since a plain column can't be converted into Custom Logic after the fact, go to the Employee table and create a brand new column, setting its type to Custom Logic from the start.

Adding a new Custom Logic column on the Employee tableAdding a new Custom Logic column on the Employee table

Describe what you want — sum the Amount field from every Sales record linked to this employee.

Describing the logic to sum linked Sales amounts for each employeeDescribing the logic to sum linked Sales amounts for each employee

Confirm the clarification screen, checking that it correctly understood you want a sum across all linked sales, not just one.

Clarification screen confirming the aggregation logic across linked Sales recordsClarification screen confirming the aggregation logic across linked Sales records

Save it, and every employee's total fills in instantly:

  • Amara Whitfield → $7,350
  • Liam Brooks → $2,100
  • Priya Nair → $7,250

Employee table showing Total Sales column automatically calculated for each employeeEmployee table showing Total Sales column automatically calculated for each employee

What just happened under the hood

Because this calculation aggregates across many linked records rather than just fields on the same row, Ambisius runs it as a trigger-based calculation — the total is stored and kept in sync through on_add, on_update, and on_delete triggers on the Sales table. That means it doesn't need to be recalculated from scratch every time you view it; it simply stays correct as sales come and go.


Step 3: Watch It React to a New Sale

Let's prove the point. Add one more sale for Liam Brooks — say, $650 — and link it to his record.

Adding a new $650 sale record linked to Liam BrooksAdding a new $650 sale record linked to Liam Brooks

Without touching the Employee table at all, his total updates immediately.

Liam Brooks changes from $2,100 → $2,750.

Liam Brooks' Total Sales field updated automatically after the new sale was addedLiam Brooks' Total Sales field updated automatically after the new sale was added

What this replaces

In a spreadsheet, adding this sale would mean finding Liam's row, re-summing his column, and hoping no one forgets to do the same for every other employee whenever their numbers change. Here, the total simply follows the data — no re-summing, no risk of a stale number sitting around.


Step 4: Turn Totals into a Leaderboard

A column of numbers is useful, but a ranked visual makes the standings obvious at a glance. Create a new chart on the Employee table, using Total Sales as the value and Name as the category, displayed as a bar chart.

Creating a bar chart using Total Sales and Name fields from the Employee tableCreating a bar chart using Total Sales and Name fields from the Employee table

The moment it's built, your team is ranked automatically:

Bar chart showing Priya Nair, Amara Whitfield, and Liam Brooks ranked by total salesBar chart showing Priya Nair, Amara Whitfield, and Liam Brooks ranked by total sales

The wow moment

This chart isn't a snapshot you built once and will need to rebuild next month — it's reading directly from a field that updates itself. Log a new sale tomorrow, and the leaderboard reorders itself without you touching the chart at all.


Recap

  1. An Employee table linked to a Sales table via One-to-Many
  2. A Custom Logic field aggregating every employee's total sales, kept in sync through triggers
  3. A live demonstration of the total updating the instant a new sale is added
  4. A bar chart turning those totals into an automatically ranked leaderboard
What you had beforeWhat you have now
Manually filtering and summing sales per employeeTotals calculated and kept current automatically
A static report rebuilt every reporting periodA chart that reorders itself as new sales come in
Numbers copied by hand into a summary sheetOne aggregated field, always accurate, always live

This same pattern — aggregating linked records into a single field, then visualizing it — works well beyond sales teams. Support ticket counts per agent, orders per customer, or hours logged per project can all be tracked the exact same way.

Try it yourself

This exact setup is available as a ready-made template. Duplicate it, explore it live, and make it yours in a few clicks.

Try the Live Preview

On this page

Related articles

Explore more product articles and best practices for teams building with Ambisius.

Still Using Spreadsheets?
You Should Try This.

Turn familiar spreadsheets into a structured system built for your business

Try Ambisius for Free

No commitment. No credit card required.

Logo Light

© 2026 Ambisius. All rights reserved.

How to Build a Sales Leaderboard That Ranks Itself