Building queries
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.
To get started with the query builder:
- 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. 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 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. - To reorder your columns, drag and drop the column names.
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.- 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. - Apply a
limit
to determine the number of rows to bring into your workbook. - Apply a
join
to join your selection with data from another datasource. - 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 also 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:
- 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.
- Select the AI Assist icon in the top-left side of the toolbar for help with writing, modifying, or debugging your query.
- 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.
- Use query version history to restore past versions of your query and the associated data.
- 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.
- 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.
Updated 5 months ago