Query Excel files with SQL
You can open an Excel file (.xlsx) in Rowpilot and query it with SQL without importing it into a database first. The file becomes a data source where each sheet you pick is a table, and you filter, group and join the sheets in the SQL editor.
File data sources are backed by DuckDB, so the SQL you write is DuckDB SQL. The file is opened in read mode and is never modified.
Open an Excel file
- Click the main app menu →
Open local file - Pick the
.xlsxfile (or enter its path) - Choose the sheets you need in the worksheet picker
- Optionally adjust the data source name and the table names
- Click
Create
You can also drag the file onto the Rowpilot window. Rowpilot detects the columns and their types and shows them in the schema tree.
Write a query
Open a new query and use the table name you chose in the dialog. In this example the workbook holds a monthly budget next to the actual spend, and the table is called budget:
The editor completes table and column names from the schema, and the result opens in the grid below the editor.
Add more files as tables
A file data source is not limited to one table. You can add another file to it, and each file you add gets its own table that you can join with the others. The path can also be a glob pattern, so a set of files maps to one table.
- Go to the right sidebar schema tree
- Click the
Add data filebutton in the schema tree toolbar - Pick the file, or enter a path or a glob pattern
- Optionally adjust the table name
- Click
Add
With a second workbook added as the table headcount, you can join the two tables:
Excel files in cloud storage
An Excel file in AWS S3, Google Cloud Storage, Cloudflare R2, Azure or behind an HTTPS URL opens the same way through Open remote file. The data is streamed on demand when you run a query, so you do not download the file first. The steps are in Query files in S3 and cloud storage with SQL.
Save the result
Export a query result or a grid selection to Excel, CSV, TSV or JSON.
Limits
- Rowpilot opens files with the
.xlsxextension. The older.xlsformat is not supported - Table names must be valid SQL identifiers: they start with a letter or underscore and contain only letters, numbers and underscores
- File data sources are read-only, so the grid shows the data but does not edit it
