Apr 19, 2026 4.8 KB markdown v1

Dataview

sublimated renders Obsidian Dataview DQL queries as live tables and lists. no plugins needed — queries evaluate server-side when the page loads.

code block queries

wrap DQL in a dataview fenced code block:

```dataview
TABLE date, purpose
WHERE date
SORT date DESC
```

queries run against all files in the current folder. each file's YAML frontmatter fields are available as columns.

inline expressions

use `= expr` anywhere in text or markdown tables for computed values:

total files: `= length(rows)`
countries: `= length(unique(filter(flat(rows.tags), (t) => startswith(t, "country/"))))`

inline expressions have access to rows — all sibling files in the current folder.

query types

TABLE

No results

renders as an HTML table. first column is always the file link.

LIST

No results

renders as a bullet list with file links.

operations

operations apply in the order written:

  • WHERE condition — filter rows

  • SORT field ASC|DESC — sort rows (multiple fields supported)

  • LIMIT n — cap number of results

  • FLATTEN field AS alias — expand array fields into separate rows

  • GROUP BY expr AS "Label" — group rows, access group items via rows variable

GROUP BY

groups all matching files by expression. each group becomes one row with rows containing the grouped items:

No results

access grouped data: rows.file.name gives array of file names in the group, flat(rows.tags) flattens all tags.

FLATTEN + GROUP BY

combine FLATTEN and GROUP BY for disaggregation/reaggregation:

No results

this expands each file's country tags into separate rows, then groups by country name.

expressions

fields

  • file.name — filename without extension

  • file.path — full path

  • file.folder — parent folder

  • file.size — size in bytes

  • file.ctime — created time

  • file.mtime — modified time

  • file.link — link to the file

  • any frontmatter field — date, tags, purpose, etc

operators

  • comparison: =, !=, >, <, >=, <=

  • arithmetic: +, -, *, /, %

  • logical: AND, OR, !

lambdas

(x) => startswith(x, "country/")

used with filter, map, sort, any, all, none.

functions

array

  • length(array) — count elements

  • contains(array, value) — check membership

  • filter(array, lambda) — keep matching elements

  • map(array, lambda) — transform elements

  • sort(array) — sort elements

  • unique(array) — deduplicate

  • flat(array) — flatten one level of nesting

  • join(array, separator) — join to string

  • reverse(array) — reverse order

  • any(array, lambda) — true if any match

  • all(array, lambda) — true if all match

  • none(array, lambda) — true if none match

string

  • contains(string, substring) — check substring

  • startswith(string, prefix) — check prefix

  • endswith(string, suffix) — check suffix

  • lower(string), upper(string) — case conversion

  • replace(string, from, to) — replace substring

  • split(string, delimiter) — split to array

  • regextest(pattern, string) — regex match test

date

  • dateformat(date, format) — format date (e.g. "yyyy-MM-dd", "yyyy")

  • date(string) — parse string to date

  • striptime(date) — remove time component

math

  • round(n), floor(n), ceil(n) — rounding

  • min(array), max(array) — extremes

  • sum(array), average(array) — aggregation

utility

  • default(value, fallback) — null coalescing

  • choice(condition, ifTrue, ifFalse) — ternary

  • typeof(value) — type name

  • string(value), number(value) — type conversion

  • link(path, display) — create link

frontmatter

YAML frontmatter is automatically extracted and stored when files are pushed. string values that look like dates (YYYY-MM-DD) are parsed as date objects.

---
title: Japan 2024
date: 2024-03-15
purpose: tourism
tags:
  - country/japan
  - city/tokyo
  - city/kyoto
---

all fields are accessible in queries: WHERE date > date("2024-01-01"), SORT date DESC, etc.

limitations

  • queries only access files in the current folder (no cross-folder queries yet)

  • no FROM clause needed — defaults to current folder

  • FROM "subfolder" resolves relative to the current folder

  • TASK and CALENDAR query types not supported

  • no custom JS views