Opening The Vault

I Can’t Believe I Wasn’t Using this Dataview Feature

Exploring the Possibilities of Inline Functions & Queries

Jake Mahr
Obsidian Observer
Published in
10 min readMar 16, 2024

--

Like many Obsidian users, my notes and templates make heavy use of the Dataview plugin. I use Dataview Query Language (DQL) to create lists and tables of notes for maps of content, and my daily note template leverages the task query to help me stay on top of todo items and events.

Also, as with many Dataview users, I have frequently referred back to the excellent documentation provided by Michael Brenan (blacksmithgu) to answer questions and to make the most out of the plugin.

In reviewing the documentation, I have come across the functions that are possible within Dataview countless times. In fact, I already use some of these functions in my own vault and Dataview queries, like in the “Birthdays” section of my daily note:

```dataview 
TABLE without ID row.file.link AS Name, Birthday, truncate(string(date(today) - Birthday),2, "") AS Age
FROM "People/People"
WHERE Birthday.month = <% moment(tp.file.title,'YYYY-MM-DD-dddd').format("MM") %> AND Birthday.day = <% moment(tp.file.title,'YYYY-MM-DD-dddd').format("DD") %>
```

Here, I use the truncate function alongside some arithmetic that uses today's date…

--

--

Jake Mahr
Obsidian Observer

Sharing some things I do/make. Learning in public while I'm at it. For now we’re looking at Obsidian, coding in R, and marketing/communications.