Cell references

Modify a SQL query by inputting values in your workbook


Workspaces will migrate to a new and improved query experience, starting the week of May 15, 2024. For more, see this help doc.

Cell references allow you to modify a value in a SQL query by simply typing into the referenced cell in your workbook. This enables anyone with edit access to your workbook to modify specific values in your SQL queries, without the need to open up access to your query or create multiple versions of the same query. You can set up cell references to toggle values like dates, products, locations, plan type, and more.

To get started, set up a live datasource connection to a workbook. Once you have a connection set up, you can refer to cells in your workbook to filter your queries by inputting values into those cells. Note: to use this functionality, you must write your query using the SQL editor.

To get started:

  1. Use the SQL editor to write a query that pulls data from a connected datasource
  2. Set up the condition in your SQL query that you want to use with a cell reference. In this case, we have a WHERE statement that we want to use to filter stripe_charges data by plan type.
  3. Click on the first icon in the toolbar to reference a cell in the query.
  4. Type into the referenced cell (in this case, cell G6) and click Run Query. The results of our query will be filtered by the plan type as specified in cell G6 (ex: pro).