I’ve not seen that combination of queries before, but I can tell for sure that the rows of the table are decided upon before the dataviewjs executes.
So I need to ask whether you need to complete tasks from this view, or is it just for presentation?
If the latter, I would rather use list(filter(file.tasks,...)) as completed & co, which would allow to check the length before presenting the row.
If you are going to keep that combination of queries you’d still need to use some filter variant in the table query to determine whether to display the row or not.
Does this make sense? Do you know how to build the filter?
Sorry, it took some time it’s been a busy week, but here is a query which hopefully should do the job:
```dataview
TABLE WITHOUT ID
link(file.link, upper(dateformat(file.day, "cccc dd/MM/yy"))) as files,
backlogTasks as "backlog",
completedTasks as "completed"
FROM
"Periodic notes/01 Daily notes"
FLATTEN
dateformat(file.day, "yyyy-'W'WW") + " Project (" + this.outcome + ")" as weekYear
WHERE
file.tasks AND contains(weekYear, this.file.name)
FLATTEN list(filter(file.tasks, (task) =>
contains(meta(task.section).subpath, "Project tasks")
AND contains(meta(task.section).subpath, this.outcome))) as projectTasks
FLATTEN list(filter(projectTasks, (task) =>
!task.completed AND task.status = "?")) as backlogTasks
FLATTEN list(filter(projectTasks, (task) =>
task.status != " " AND task.status != "?")) as completedTasks
WHERE length(backlogTasks) > 0 OR length(completedTasks) > 0
```
It’s hard to test, and there is one vital difference between your query, and this query, and that is that this query will display the task text, and not an interactive task. But please do test out if this query displays the correct tasks, and removes the empty rows you wanted to remove.
If it does do that, you might re-use the inline queries you used for the backlog and completed columns from your script and the rest from my version, but I must say that I was kind of surprised this combination of multiple queries with both a pure DQL query and those inline queries actually somewhat worked.
Hopefully this should bring you a step closer to your wanted result.