Skip to content

Query Builder

Query Builder

The Query Builder provides a SQL-like interface for querying your spreadsheet data. Each sheet acts as a table, and the first row of each sheet is used as column headers.

Opening the Query Builder

Open it via Data > Query Builder in the menu bar.

Writing Queries

Enter SQL in the query textarea. Supported clauses:

SELECT columns
FROM SheetName
WHERE conditions
GROUP BY columns
HAVING conditions
ORDER BY columns [ASC|DESC]
LIMIT n

Examples

-- Select all rows from Sheet1
SELECT * FROM Sheet1

-- Filter and sort
SELECT Name, Amount FROM Sales WHERE Amount > 100 ORDER BY Amount DESC

-- Aggregation
SELECT Category, SUM(Amount), COUNT(*) FROM Sheet1 GROUP BY Category

-- String matching
SELECT * FROM Customers WHERE Name LIKE '%smith%'

-- Top N results
SELECT * FROM Products ORDER BY Price DESC LIMIT 10

Supported Features

SELECT expressions: - Column names (from header row), * for all columns - Aggregate functions: SUM, COUNT, AVG, MIN, MAX - String functions: UPPER, LOWER, TRIM, CONCAT - DISTINCT to remove duplicate rows - Column aliases with AS

WHERE operators: - Comparison: =, !=, <>, >, <, >=, <= - LIKE with % (any chars) and _ (single char) wildcards - IN (value1, value2, ...) - BETWEEN value1 AND value2 - IS NULL / IS NOT NULL - AND, OR, NOT for combining conditions

Column names with spaces or special characters can be quoted with backticks or double quotes: `Full Name` or "Full Name".

Running Queries

Click Run Query or press Ctrl+Enter to execute. Results appear in a scrollable table below the query input, with row count displayed in the status bar.

Saving Queries

Click Save Query to name and store the current query. Saved queries appear in a list at the bottom of the panel and are persisted to localStorage. Click a saved query to load it back into the editor.

Generate Report

After running a query, click Generate Report to open a formatted HTML report in a new browser window. The report includes:

  • Query text and timestamp
  • Results table with alternating row colors
  • Print button and CSV download button