Skip to content

Scatter plot

The scatter plot widget plots each row as a point positioned by two numeric measures — one on the X axis, one on the Y axis. It is the tool for spotting correlation, clusters, and outliers across your users, sessions, or events.

Use it for:

  • Sessions per user vs total playtime
  • Level reached vs money spent
  • Any two per-entity metrics you suspect are related

Return rows with at least two numeric columns:

  • The first numeric column is the X axis.
  • The second numeric column is the Y axis.
  • An optional non-numeric column is used as the point label (shown in the tooltip).
  • An optional third numeric column drives the bubble size.

Each row becomes one plotted point, so aggregate per entity (e.g. GROUP BY identity).

SELECT
identity,
uniqExact(session_id) AS sessions,
dateDiff('minute', min(timestamp), max(timestamp)) AS playtime
FROM {table}
WHERE name = 'app_started'
GROUP BY identity
LIMIT 1000

Result shape:

identitysessionsplaytime
a1b2…12340
c3d4…345

Here sessions is the X axis, playtime is the Y axis, and identity labels each point.


Add a third numeric column to scale each point by a third dimension:

Full SQL:

SELECT
identity,
uniqExact(session_id) AS sessions,
count() AS events,
countIf(name = 'purchase') AS purchases
FROM {table}
GROUP BY identity
LIMIT 1000

sessions → X, events → Y, purchases → bubble size.


Engagement vs spend per user

Full SQL:

SELECT
identity,
count() AS events,
sumIf(toFloat64(value.amount), name = 'purchase') AS spend
FROM {table}
GROUP BY identity
LIMIT 1000