Tally logoTally
API Docs

Clay playbook

How to rank rows across a Clay table

Clay runs each row in isolation. That's great for enrichment and terrible for ranking — there's no native way to ask "is this lead in the top 10% of my table?".

Why Clay can't do it natively

Formulas are row-local. AI columns are row-local. Even table-wide aggregations refresh on a separate cadence from the row that needs the answer. By the time the aggregation finishes, downstream actions have already fired with stale data.

You need a store that holds every row's score and can answer "where does this one rank?" the moment the row is processed.

The sidecar pattern

Add two HTTP API columns to your Clay table:

  1. POST the score. Send { row_key, score } to a store keyed by your scope (campaign, segment, table).
  2. GET the rank. Query the same scope for this row's rank, percentile, and whether it's in the top-N.

That's it. The store handles ordering, ties, and TTL. Clay just sees two extra columns: percentile and in_top_n.

Tie handling matters more than you think

Three leads tied at the 10th position when you need the top 10. Do you include all of them? Drop them? Take the first by row order? Tally supports four explicit policies — competition, dense, all, and none — so the behavior is deterministic instead of whatever your spreadsheet defaulted to.

The shortest path

Tally is exactly this sidecar. Free tier covers small tables, one HTTP call per row, no infra.