SQLDesk

Visualizations

A visualization belongs to a query and draws its rows. One query can have many, and they all show the same data — so fixing the SQL fixes every one of them.

Choosing one

You want to showUse
Rows, as rowsTable — with per-column formatting, colouring and data bars
Something over timeLine, area, or a stat with a sparkline
Categories comparedBar or column; horizontal bars when the labels are long
One number that mattersCounter, or Gauge when there is a target or a healthy range
Parts of a wholePie for a handful of slices; a stacked bar for more
Progress toward a targetProgress bar, bullet bar, or Gauge
Status across many thingsStatus grid — one tile per row, coloured by a column
Two numbers relatedScatter, or a bubble chart with a third for size
Where something isMap (markers), or Choropleth for regions
Flow between stagesSankey, or Funnel for a conversion sequence
DistributionHistogram or box plot

This is the drill-down: click a bar, land on the query, dashboard or system that explains it. It is configured per visualization, and the important part is that the link is built from the row — so one setting makes every point link somewhere different.

On a chart

Open the visualization editor and go to General. Tick Enable click events — until you do, the two settings under it stay greyed out and clicking a point does nothing:

Enable click events
Makes the points clickable. Nothing below works without it.
Open in new tab
Usually what you want from a dashboard somebody is watching.
URL template
A URL with placeholders filled in from the point that was clicked, for example /dashboards/12?p_region={{ @@x }}. The braces are part of it.

The placeholders are:

Values go in raw, not formatted: a tooltip may read 1.2k, but the URL gets 1200, because the other end has to be able to look it up. A placeholder that matches nothing is replaced with an empty string rather than left in the URL.

A worked example. A column chart of revenue by region, where clicking a column opens a dashboard filtered to that region:

Enable click events:  yes
Open in new tab:      yes
URL template:         /dashboards/7-regional-detail?p_region={{ @@x }}

Because {{ @@x }} is filled in per point, the North column links to North's dashboard and the South column to South's. There is no per-point configuration.

Charts have no link text setting — the whole point is clickable, and there is no label to write. Per-cell link text is a table thing, below.

On a table

A table column can be a link instead of text. In the visualization editor choose the column, set its Display as to Link, and fill in:

Note the difference from a chart: a table's placeholders are column names, with no @@ in front of them. That prefix belongs to charts, where there are no column names to use. {{ @ }} is the one shorthand here — the value of the column being displayed.

Any column of the row can be used, not only the one being displayed. A common shape is to select an id you never show, and use it to build links in the column you do.

If the link does not appear

Formatting numbers

Every numeric column and most chart values take a format string. It is applied in the browser, so it changes what is shown and never what was fetched.

Format1234567.891 becomes
0,01,234,568
0,0.001,234,567.89
0.0a1.2m
$0,0.00$1,234,567.89
0.00%applied to 0.1234 gives 12.34%
0[.]00decimals only when there are any

Thousands and decimal separators follow the organization's setting, so the same format string reads correctly for everyone.

Dates and times

Times are stored as the warehouse returned them and displayed in the organization's configured format. If a chart's x axis looks wrong by exactly some number of hours, the column is almost certainly a timestamp without a time zone — the fix belongs in the SQL, where the intent is known.