Building queries (COPY)

Query datasources from your Equals workbook

With Equals, you can connect to and query datasources directly from your workbook to bring live data into your spreadsheet for further analysis.

Before you get started, ensure that you have at least one datasource configured for your workspace.

Connecting a sheet to a datasource

When you create a new workbook, you'll be prompted to start with a blank sheet or a connected sheet. Select connected sheet in order to select a datasource and begin building or writing your query.

When creating a new sheet in an existing workbook, click Connect data in the top-right of the toolbar to connect that sheet to a data source.

Once you have selected a datasource to connect to, you'll be prompted to choose between the Query builder and SQL editor. You can switch between query editors at any point from the Settings panel, accessible from the right side of the toolbar.

Using the query builder

If you don't know SQL and want to access your data, you can do so with the query builder. The query builder provides an instant preview of the first 100 rows of your query results as you build, making finding and selecting the exact data you need faster and more fluid.

To get started with the query builder:

  1. Search for tables or columns in your data schema using the Select tables & columns dropdown at the top of the query builder. Then, check the boxes to bring specific columns into your query.
  2. To add a calculated column or data note column from the query builder, select + Add column. You can also add calculated columns by right-clicking a column header in your connected sheet and choosing Add calculated column.
  3. To reorder your columns, drag and drop the column names.
  4. Filter your data by first selecting the + button next to Filter, then selecting the column you want to filter. You'll see a pre-populated list of values in that column. Select the value(s) you want to filter on, and then set a conditional filtering rule.
  5. To apply a sort, select the + button next to Sort. Select the column you want to sort by, then choose whether to sort by ascending or descending order.
  6. Apply a limit to determine the number of rows to bring into your workbook.
  7. Apply a join to join your selection with data from another datasource.
  8. To convert your query into a saved query that can be reused across workbooks, select the Saved query option (a box icon) at the top of the query builder.

Once you have customized the selection to your liking, select Run Query to save your changes and see your data populate in the sheet. You can also select Discard change in the top right to revert back to your original query.

After running your query, you can add sheet filters and shorts directly to your Worksheet. Any sheet filters you apply to a column in a connected sheet can be added directly to your query as a query filter.

Using the SQL editor

Use the full-featured SQL editor to write a traditional SQL query. The SQL editor includes several features that make it easy to configure your selection.

To get started with the SQL editor:

  1. Select the table browser from the top-right side of the toolbar to search for specific tables or columns in your data schema by name. You can hover over each column to preview a sample of the data in that column.
  2. Select the AI Assist icon in the top-left side of the toolbar for help with writing, modifying, or debugging your query.
  3. Select cell references at the top of the SQL editor to include a variable in your SQL query that can be easily modified by typing into the referenced cell in your workbook.
  4. Use query version history to restore past versions of your query and the associated data.
  5. At any time, you can select the Expand editor option at the top of the SQL editor to expand to a full-width editing experience.
  6. Select the Saved query option from the top of the SQL editor convert your query into a saved query that can be reused across workbooks.

Once you have written your query, press Run Query to see your data populate the sheet.

Switching between query interfaces

You can choose to switch between the SQL editor and query builder for a given datasource connection. The option to switch between interfaces is accessible from the Settings menu in the top-right corner toolbar. Note that this will affect all users working with that datasource connection in your workbook.

Switching from the query builder to the SQL editor will convert your no-code query into SQL syntax.

Switching from the SQL editor to the query builder will cause you to lose your SQL query, as we can not translate a handwritten SQL query into the builder interface.

FAQ

Can I connect to multiple datasources within a single workbook?

Yes, you can connect as many datasources as you'd like within a single workbook, but only one datasource can be connected per sheet. To connect an additional datasource, simply open a new sheet, go to the Connections panel and choose your datasource.

Who has access to my query?

Generally, workspace users with access to the datasource your query is built on will also have access to view and edit that query. You can share individual access to a query by creating a saved query and that sharing Run or Edit access to individual users (more on saved queries here).

What do I do if my query is not running?

If your query is crashing or not running as expected, reach out to us at [email protected] or message us directly using the messenger widget in the bottom right corner of your screen.