Obsidian Dataview

Tip

Use LIST query and typeof() function to facilitate debugging! Make sure types are compatible!

Metadata

  • Use inline metadata to include metadata semantically. e.g. I would rate this film as \[rating:: 9\]. (ignore backslash)
  • Bracketed inline metadata is the only way to annotate a list item such as todo.
  • Combined with inline tags and TASK query, this can be used for task management. Compare with obsidian-tasks

Query Commands

  • To reformat the date, use date(file.cday, "yyyy-MM-dd") — note that this function does not take array.

Data Commands

GROUP BY

map(rows.file.cday, (x) => dateformat(x, "MMM, dd")) AS "Date"
  • When the field is nested, may need to flat() them. See dashboard for example.
flat(rows.file.etags) AS Tags,

SORT

  • To sort notes within each group while using GROUP BY, make sure to put SORT command before GROUP BY command. See mooc-catalog for example.

WHERE

  • In filtering boolean fields, null type is treated as false. Filter null items out first if necessary. See dashboard for example.

Functions

  • Note that, some functions does not take array as input, they can’t be used on rows objects.