Filter task in dataview to keep only not done tasks

What I’m trying to do

Hi, I’m currently have a dataview table which gives the list of task in a given project. I would like to filter this list to have only uncompleted tasks.

Here is my current dataview :

TABLE task.text as "TODO", task.scheduled as "Schedule",
task.due as "Due Date"
FROM "02 TASKS" 
WHERE contains(file.outlinks, [[Nouvelle interface]])
FLATTEN file.tasks AS task

Things I have tried

I tried to add the line :

  • WHERE !task.completed
  • WHERE !task.isDone
  • WHERE task.status!=‘x’
    and … a lot of other things I don’t remember right now

Thanks in advance for your helps :slight_smile:

I had struggled a lot with the same problem.

You’ll have to list all task and filter out the ones you don’t want.

This is what worked for me (the relevant part of my query):
You still need to add your FROM and WHERE, but fetching the Tasks and filtering them does not happen in the WHERE.

```dataview
TABLE  
OpenTasks.text as "Open Tasks", 

FLATTEN list(flat(file.inlinks.file.tasks)) as AllProjectTasks
FLATTEN list(filter(AllProjectTasks, (task) => !task.completed)) as OpenTasks
```

Here is my full query just in case it helps:

```dataview
TABLE  
OpenTasks.text as "Open Tasks", 
Urgency as Urgency, 
DueDate as Date,
Responsible + "<br>" + Department as "Responsible and Department",
embed(link(meta(CoverImg).path, "125")) as "Image"

FROM "Projects"

WHERE file != this.file
WHERE Completed = False and Limbo = False 

FLATTEN list(flat(file.inlinks.file.tasks)) as AllProjectTasks
FLATTEN list(filter(AllProjectTasks, (task) => !task.completed)) as OpenTasks
```

Hope that helps!

Where did you add either of those lines? Before or after the FLATTEN?

I tried both :melting_face:

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