What I’m trying to do
I’m trying to filter my query results by the properties of inlinked files.
My setup
In my setup I have both project and action files. Action files are linked to their respective project files via inline fields. Each project and action file also has it’s own status defined via an inline field.
Sample project file metadata
type:: #project
project-status:: #ps/current
Sample action file metadata
type:: #action
project:: [[P-Project name]]
action-status:: #as/now
people::
What I would like in the end is a list of projects who have no actions with the status #as/now
. So in other terms projects that don’t have a next action defined.
Things I have tried
I have a query that looks for all the actions that have the status #as/now
in all the projects of various statuses, so thought that this would be a good starting point:
TABLE WITHOUT ID file.link, project
FROM #as/now
WHERE contains(project.project-status, "#ps/current") OR contains(project.project-status, "#ps/urgent") OR contains(project.project-status, "#ps/perpetual")
SORT choice(project.project-status = "#ps/urgent", 1, choice(project.project-status = "#ps/perpetual", 2, choice(project.project-status = "#ps/current", 3, 99 ))), project, file.link
and from this I got:
TABLE WITHOUT ID file.link
FROM #ps/current
WHERE file.inlinks.action-status != "#as/now"
but upon testing the results aren’t 100% what I’d expect so I refined it as follows:
TABLE WITHOUT ID file.link
FROM #ps/current
WHERE file.inlinks.type = "#action" AND file.inlinks.action-status != "#as/now"
OR !file.inlinks
but the results are still off … I feel that I’m right on the tip of it but can’t seem to place the mistake