Dataview table: Projects Notes linking to Areas notes

What I’m trying to do

I’m trying to get a table of Project notes (type: project_note; in folder “Projects” and Subfolders) that have outgoing links to notes (type: area_note) in “Areas” folder (and subfolders) so that I can see a list of all projects connected to specific areas.
For example under area column:
COURSES
and in Project Column
Course1
Cours 2
Etc.

Then under area column:
RESEARCH
and in Project Column
Research 1 etc.

Things I have tried

This code:
table without id file.outlinks as AREAS, file.link as PROJECTS from "PARA/PROJECTS" WHERE type = "project_note" and type != "meeting"
But the results in column AREAS includes notes that are actually in “Projects” folder…what am I doing wrong?

In your query you only focus on limiting the files to those being projects, through the use of WHERE type = "project_note". In addition you need to filter out the links which are not areas when presenting the links. This can be done through the filter() function of Dataview.

So here is a variant of your query doing just that:

```dataview
TABLE WITHOUT ID
  filter(file.outlinks, (ol) => ol.type = "area_note") as Areas,
 file.link as Project
FROM "PARA/PROJECTS"
WHERE type = "project_note" 
  AND type != "meeting"
```

This should produce a list of every project with the corresponding areas of that project. Not sure that the last type != "meeting" has any meaning, since if type has just one value, it can’t be both a project_note and a meeting so the first test should be enough… And type could hold multiple values, aka being a list, then these tests should be switched out with contains(type, "project_note").


If you use case is slight different, and and you rather want to focus on which projects belongs to different areas. In other words, that you want to mainly focus on the different areas first, instead of a project first based approach, you’d need to switch the query around.

```dataview
TABLE  filter(file.inlinks, (il) => il.type = "project_note") as Projects
FROM "PARA/AREAS"
WHERE type = "area_note" 
```
1 Like

You’re right thanks @holroy ! The Query I actually needed Washington the second one…:nerd_face:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.