[DataView] Filter out subtasks based on both parent and child metadata

Is it possible to filter out subtasks based on both parent and child metadata?

What I’m trying to do

I have a simple Project → Task structure where both projects and tasks have a status. I’d like to create a Dataview query to find all projects with project-list-status = "current" and then list all tasks where task-list-status = "now"

Things I have tried

Given the following structure:

- [ ] Project A [project-list-status:: current]
	- [ ] Buy a kite [task-list-status:: now]
	- [ ] Fly my new kite [task-list-status:: next]

- [ ] Project B [project-list-status:: following]
	- [ ] Buy a boat [task-list-status:: now]
	- [ ] Sail my new boat [task-list-status:: next]

I’ve tried the following (and variants of) the following query:

TASK
FROM "Text tasks"
WHERE project-list-status = "current"
WHERE subtasks.task-list-status = "now"

This particular one results in no results. I then changed to the contains method, but it doesn’t filter out the task “Fly my new kite”

TASK
FROM "Text tasks"
WHERE project-list-status = "current"
WHERE contains(subtasks.task-list-status, "now")

Are you missing the main task from the kite example? Or is that just a task at a secondary level without a project task setting?

1 Like

ah oops my mistake - will update now, was a typo – question still remains :slight_smile:

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