The workspace editor

The workspace editor allows topspin users to aggregate multiple queries into a cohesive visualization. Usually you need multiple queries to tell a story. The workspace editor enables you to compare many different sets of data and then share that comparison with the internet.

How do I use this?

  1. Create a set of queries. Build the tables you want to plot on a chart. Think about comparing different teams and players across time and dimensions.
  2. Promote those queries to a workspace. From a saved query’s own menu: Promote to a new workspace for the first, Promote to an existing workspace for the ones that join it.
  3. The workspace suggests a visualization. The topspin system is capable of parsing the queries in a workspace and suggesting all the possible visualizations.

NFLExample 1: Comparing teams or players across two different dimensions

Save two queries that differ by a single filter, promote both into one workspace, then draw them as a scatter. Topspin will take the team name from the query and label the dot. You can invert either axis if lower is better for a given stat. A highlight line in each query marks the dot on the scatter plot, and the four corners can be labelled with chart configuration options.

The chart below has two queries that pull every NFL team’s sacks made and sacks allowed across two different years. We highlight one team to compare that team’s difference between years.

Sacks made against sacks allowed, 2024 and 2025Sacks made against sacks allowed, 2024 and 2025

NFLExample 2: Comparing two teams or players across many dimensions

Save two queries that select the same five numbers and pin each to one season, promote both into one workspace, then draw them as a radar. Each query becomes one shape; every spoke is scaled to whichever of the two leads it, so the outline is the comparison.

The below visualization shows how the New England Patriots improved in several different statistical categories year over year.

New England, 2024 against 2025New England, 2024 against 2025

NFLExample 3: Joining multiple percentile rankings from different stats

Save two queries that select different numbers about the same teams or players and promote both into one workspace, then write a workspace query over them. The results of the two queries become one table. The topspin system will join on the column they both name, and percentile(...) turns each number into a place among the rows the original query returned.

The visualization below shows how the LA Rams were the only team in the > 80th percentile in both passing touchdowns and passing interceptions in 2025. This was a solid argument for Matt Stafford during a heated MVP race.

Touchdowns thrown and interceptions, as places in the leagueTouchdowns thrown and interceptions, as places in the league

MLBExample 4: Comparing a team's value to the league average over time

Save two queries that differ by a single filter but match a month or year column, promote both into one workspace, then draw both lines on the same chart.

The below visualization shows the Pittsburgh Pirates’ bullpen xFIP month over month compared to league average.

Pittsburgh's bullpen against the league, by monthPittsburgh's bullpen against the league, by month

Reading the answers: the workspace query

Every workspace has a query of its own, written under the chart. It reads the answers of the queries in the folder as one table — the columns each of them selected, keyed by the columns they share — so percentile(...), calc(...), order by and keep work over numbers that came from different tables. Example 3 above is one.

Three things about it are worth knowing before you write one.

One query is enough

A workspace holding a single query still has a workspace query, and re-reading one answer at a coarser grain is one of the commonest reasons to write one:

select team, count(*) as Quarterbacks, percentile(count(*)) as LeaguePercentile
group by team
order by count(*) desc

over an answer holding one row per club and quarterback counts the clubs’ rows and ranks the counts. Nothing else has to be in the folder for that to be a legal question.

join on names the key, and lets one answer be coarser than another

Without it, the key is inferred: the columns every query in the folder selects. That is right when the queries are at the same grain and wrong twice when they are not — when the shared key is finer than the question, and when one answer is a fact about a group while another is its detail rows.

join on team
select team,
       count(*) as Quarterbacks,
       only(win_pct) as WinPct
group by team

With the key written down, one query may hold several rows per key and the rest are repeated across it. So an answer with one row per club sits beside an answer with one row per club and quarterback, which is the ordinary business of putting a group’s fact next to its detail rows. Exactly one query may be the detailed one; two of them is an ambiguity and is refused.

only(...) is how a repeated value is folded

A column that was broadcast holds the same value in every row of its group. sum is wrong about it, avg is right only by accident, and neither says what was meant. only(x) returns the group’s one value and fails loudly if a group turns out to hold two — which catches a grain mistake instead of averaging it away.

Folding twice without a workspace

Some questions are two folds and need no folder at all. then closes a stage of a query and starts a new one over the rows it returned:

from nfl.plays
where play_type = pass
select team, passer, count(*) as Dropbacks
group by team, passer
having count(*) > 100
then
select team, count(*) as Quarterbacks
group by team
order by count(*) desc

The first stage says what each club-quarterback pair is worth and drops the pairs under the threshold; the second counts the pairs that survived. The second stage reads the first’s columns by their output names — Dropbacks, here — and nothing else: the table underneath is gone by then. It is one document, so it saves and shares as one thing. See then on the language reference.