Fill slides from your data

A chart, table or text on a slide can take its numbers from a SQL query on your Lake and Warehouse, instead of values you type. Use it when a deck has to show current figures, and read the roles section before you share the deck. To type the numbers yourself or format a chart, see Charts and tables.

Bind a chart to a query

  1. Select the chart. In the Properties panel, under Chart, click Enter data. The Chart data dialog opens.
  2. Switch the view to Live query.
  3. Click Bind to a query.
  4. Pick the Role and write the SQL, for example SELECT ... FROM "<role>_WH"."Sales".
  5. Click Check query, then Run. Query result shows the columns and the row count.
  6. In the column beside the result, pick the Category column and the Series columns.
  7. Click Run and fill. The chart takes the numbers.
  8. Choose a Refresh mode. The options are described under Choose when the numbers refresh, below.

Check query checks the statement without running it. The column list appears only after a Run, because it comes from the last executed statement.

Bind a table or text to a query

Table: select the table and click Enter data under Table. The Table data dialog shows the grid above the query panel. Click Bind to a query, then follow steps 4 to 8 above. Under Table columns, left to right, pick the result columns in order: the first column you pick fills the first table column, and so on. While a table is bound, its cells refresh from the result and cannot be typed over. Unbinding keeps the rows as plain cells you can edit.

Text: select the text and, in the Text section, click Bind to a query. The Text query dialog opens. The text shows the first cell of the result exactly as the query returned it. A run that returns more than one row or column still fills from the first cell and warns that only the first cell is used. An empty result writes a dash instead of the number.

Settings and defaults

SettingWhat it doesDefault
RoleThe role the query runs as. The query may read only that role's databases.The first role you hold; it becomes part of the binding when you start writing SQL.
RefreshWhen the query runs on its own.Only when refreshed by hand
Category column and Series columnsWhich result columns fill a chart's categories and series.Empty until you choose them.
Table columns, left to rightWhich result columns fill a table, in order.Empty until you choose them.

What the panel tells you

Choose when the numbers refresh

Each refresh is one undo step, so Ctrl+Z puts the previous numbers back. A refresh by hand changes the deck, so the new numbers are saved with your next save. A whole-deck run is a single undo step however many elements it touched.

If a query fails when the deck opens, the notice Live data could not be refreshed appears with Those elements are showing the values saved with the deck., and the elements keep their saved values. Failures never block an export. For the messages behind a failed run, see Slides troubleshooting.

How bound roles restrict a deck

A bound query is pinned to a role, and that role decides where the deck can go.

Important

A bound deck can be shared only with people who hold its required roles. Check Required roles before you publish.

Limits

To write, check or run a query, and to refresh by hand, you need Bind Slide Chart To SQL. It is part of the Slide Chart SQL Binder bundle and is not in the Slides Editor preset. See Slides permissions. For the SQL rules, see SQL dialect and data scope.

Questions, answered

Which tables can my query read?

Only the bound role's own databases, which the note under Role lists: the role's Lake, WH and Temp databases. Name every table in full, like "<role>_WH"."Sales" or "<role>_Lake"."Table". A table outside those databases is refused.

What is the difference between Check query, Run and Run and fill?

Check query checks the statement without running it, so it confirms the query stays inside the role's databases. Run shows rows in Query result without changing the element. Run and fill writes the result into the element. One query runs at a time.

Why did Run and fill write nothing?

The query still runs, but a run that cannot fill the element changes nothing. If no query is written, the panel flags the editor and asks for a role and a query first. If the mapping is incomplete, the panel asks for the columns it needs, for example Nothing was filled yet. Pick the category column and at least one series, then run it again.

Why is the column list empty until I run the query?

Check query only checks the statement; it never runs the query. The column list comes from the last run, so run the query once first. The panel says so: Run the query once to read its result columns, then map them onto the chart.

Do viewers see fresh numbers?

Only if the element refreshes when the deck opens or when a show starts, and the viewer can open the deck and holds the role the query is bound to. Viewers cannot run ad-hoc SQL: the automatic runs use the queries saved in the deck's current version. Otherwise viewers see the values saved with the deck.

Does opening a deck with live elements create a new version?

No. The refresh on open does not change the deck. If you have unsaved edits, the new numbers are saved with your next save. See Saving and version history.

Can I undo a refresh?

Yes. Each refresh is one undo step, so Ctrl+Z puts the previous numbers back. A whole-deck run is a single undo step however many elements it touched.

Can my query use several statements or INSERT?

No. A query is one statement that starts with SELECT or WITH. Statements that change data are refused.

Why does my bound text show the value exactly as the query returned it?

A bound text keeps the first cell of the result exactly as the query returned it, so the formatting comes from the SQL. Round it, scale it or add units in the query, so the slide, the PDF and PowerPoint show the same characters.

Why does my bound text show a dash instead of a number?

The last run returned no value, so the text writes a dash rather than keeping a stale number. Change the query until it returns the value you want.