Skip to content

DB.SOURCE

=DB.SOURCE names a data source and binds it to a SQL alias. The cell it returns is what you pass to =DB.QUERY and =DB.SCHEMA; the alias is how you refer to the source inside your SQL.

Naming the source in its own cell keeps Excel’s recalc graph honest: every query that depends on a source depends on the cell, so editing or moving the source re-runs the queries that use it.

=DB.SOURCE(source, alias)
ParameterTypeDescription
sourcetext or rangeA remote URL, a local file name, or a worksheet range. See the three shapes below.
aliastextThe name you’ll use for this source in SQL. Must be a valid SQL identifier.

An http(s):// URL pointing at a file. The format is inferred from the extension:

ExtensionRead as
.parqueta single Parquet file
.csv, .csv.gza CSV file (gzip is decompressed automatically)
.jsona Files manifest — a JSON document listing the Parquet files of a partitioned (Hive) dataset
=DB.SOURCE("https://dev-fdb.sumpalabs.com/samples/sales.parquet", "sales")

The .json manifest shape is remote-only — it lists relative paths that resolve against the remote host, so a local manifest has nothing to resolve against.

A bare file name — no http://, just the name — for a file you added through the task pane file picker. Supported extensions are .parquet, .csv, and .csv.gz. The file is read in the browser and never uploaded.

=DB.SOURCE("sales.csv", "sales")

Pick the file in the task pane first; the name in the formula is matched against the files you picked this session. (A local .json manifest is not supported — pick the Parquet files directly instead.)

A range reference binds the cells themselves as a source. The first row is read as the column names. The source cell stores only the range’s address — never a copy of the values — so =DB.QUERY reads the live cells each time it runs.

=DB.SOURCE(A1:C11, "regions")

A named range or an Excel Table binds the same way. For a Table, use [#All] so the header row is included:

=DB.SOURCE(RegionTable[#All], "regions")

When the range, named range, or Table grows, the queries that use it update automatically.

The alias must be a valid SQL identifier:

  • letters, digits, and underscores only;
  • it must not start with a digit (it may start with an underscore);
  • it must not be a SQL reserved word such as SELECT, FROM, or WHERE.

Plain names like sales, regions, wells_2024, or data are all fine.

=DB.SOURCE must live in its own cell. Writing it inline inside =DB.QUERY — for example =DB.QUERY("…", DB.SOURCE("…","s")) — is rejected with #VALUE!. Put the =DB.SOURCE in a cell and pass a reference to that cell instead. This is what keeps the dependency visible to Excel’s recalc.

ConditionCell errorMessage
The extension isn’t .parquet / .csv / .csv.gz / .json#VALUE!Unsupported source ”…”
A bare .json filename (local manifests aren’t supported)#VALUE!Unsupported source ”…”
The alias isn’t a valid identifier#VALUE!Alias ”…” is not a valid SQL identifier
The alias is a SQL reserved word#VALUE!Alias ”…” is a SQL reserved word
=DB.SOURCE was written inline inside =DB.QUERY#VALUE!(the inline source is rejected)

Name the samples sales file, then query it:

A1: =DB.SOURCE("https://dev-fdb.sumpalabs.com/samples/sales.parquet", "sales")
B1: =DB.QUERY("SELECT COUNT(*) AS orders FROM sales", A1)
  • =DB.QUERY — query the sources you named here.
  • =DB.SCHEMA — list a source’s columns.
  • Examples — remote, JOIN, and range-source worked examples.