The setting
There are area notes, every area has a common tag “area” and its own tag. Example:
[[Area A]]
tags:
- area
- areaA
Then there are project notes, every project has a common tag “project”, its own tag, and a property called area containing a list of links to area notes (a project might belong to more than one area). Example:
[[Project A]]
tags:
- project
- projectA
area:
- "[[Area A]]"
- "[[Area B]]"
[[Project B]]
tags:
- project
- projectB
area:
- "[[Area A]]"
- "[[Area C]]"
Finally, there are meeting notes, these contain a tag for the project or area. (a meeting can focus on a project, on several projects, or on an entire area). Example:
date: YYYY-MM-DD
tags:
- projectA
attendees:
- "[[Person A]]"
- "[[Person B]]"
- "[[Person C]]"
What I’m trying to do
I’m trying to create a dataview query in my Area notes to list all related meeting notes. These meetings can be either directly tagged with the area’s tag or tagged with a project’s tag, where the project is linked to the area in its note.
I already have the following working:
Project notes have dataview queries to see the meeting notes related to that project:
table without id file.link as "Notes", dateformat(file.ctime,"yyyy-MM-dd") as "Meeting Date"
from #projectA AND "Projects/Meeting Notes"
sort file.ctime asc
Area notes contain a list of projects linked to that area
table without id file.link as "Projects", tags as "Tags"
WHERE contains(tags, "project") AND contains(area, this.file.link)
sort file.ctime asc
What I’m stuck on is how to list meeting notes for the area that are tagged with project tags, based on the relationship between the projects and the area, rather than having to tag the meetings with area-specific tags. In other words, what I am trying to solve is adding into area notes another query, finding their related meeting notes. To find area meeting is quite simple. By contrast, I can’t solve how to find meetings containing project tags, that are associated to a certain area inside the project note rather than in the meeting itself.