I’m trying to create a Dataview query in Obsidian that will automatically show meeting notes from a “Meetings” folder that correspond to the date of the current daily note in the
“2. Journaling/2. DailyNote/yyyy-MM” folder.
Folder and Filename Structure:
- Daily Notes: Stored in
2. Journaling/2. DailyNote/yyyy-MM
and named in the formatdd.MM EEEE
(e.g.,30.September Freitag
). - Meeting Notes: Stored in a separate
Meetings
folder, with filenames in the formatyyyy-MM-dd
(e.g.,2024-09-30 Meeting with John
).
Goal:
I want a query in my daily notes that:
- Extracts the day and month (
dd.MM
) from the daily note’s filename. - Extracts the corresponding day and month (
MM-dd
) from the meeting note’s filename. - Displays a list of meeting notes that match the current daily note’s day and month.
What I’ve Tried:
- I’ve tried using
regexmatch
andsubstring
to extract and compare the day and month from the filenames, but I’ve either gotten incorrect matches or no results. - Here’s a sample of the last query I tried for matching the dates:
dataview
TABLE file.name AS "Meeting Notes", file.link AS "Link"
FROM "Meetings"
WHERE substring(file.name, 6, 5) = regexmatch("^\\d{2}\\.\\w+", this.file.name)
This query doesn’t return any results, and I’m unsure whether the date extraction or the comparison is failing.
Request:
- How can I effectively extract the date portions from both types of filenames and compare them correctly in a Dataview query?
- Is there a better way to approach this problem or to debug it further?