My Obsidian grew bigger this year and I cannot keep track of everything manually anymore. I installed the dataview plugin and started fiddling with some filters, however, I’ve hit a roadblock and that’s why I’m asking here!
So, I’m trying to get a list of files I need to review. In my project management system, a project needs to have at least one uncompleted task marked as next, otherwise either the project is blocked or it’s completed and moved elsewhere.
This is the query I have so far, the best I could do
TASK
FROM "4. Projects/1. Active"
WHERE !completed AND !contains(tags, "#next")
GROUP BY file.link
However, this doesn’t work. It just shows files with open tasks (and all the tasks in them), and I cannot find a way to exclude them if there’s an uncompleted task tagged as #next, nor to show only the file link.
Any idea?
I started fiddling with dataviewjs, but it’s too difficult for me
Edit: I started working on another filter for my system, and hit another unknown
Basically, each project in that folder also needs to be linked to one or more AREAS thanks to a areas:: inline field.
I would like to also have a list of AREAS (stored in “2. Areas/1. Active”) that DO NOT have a project linking to them, for maintenance. I tried checking file.inlinks but I must be doing something wrong. Any idea for this too? Didn’t want to open a new topic I am already asking too much stuff!
Have you tried the query mechanism of Obsidian Tasks?
You will not be able to filter based on a page, but if a task resolution works for you, this is easily to accomplish.
Isn’t this what I’m doing with that query? That one returns ALL the tasks grouped by ALL the documents in that folder that are NOT tagged #next, including the ones in a document that also has an uncompleted task tagged #next (that task is, of course, not showing)
However, I’m interested in retrieving just links to the pages that do not contain an uncompleted task tagged #next. If this task filter could exclude tasks from a document with an uncompleted task tagged #next, I would be partially satisfied. But this result is not useful for me, sadly
---
Date: 1998-03-01
---
## input
### main tasks
- [ ] 1998-03-01 add this feature_a #Test/d01 [[Note P]] , [[Note Q]]
- [ ] 1998-03-02 add this feature_b #Test/d02 [[Note P]]
- [ ] 1998-03-03 add this feature_c [[Note Q]]
- [ ] 1998-03-04 add this feature_d #Test/d04
- [x] 1998-03-05 add this feature_e #Test/d05 [[Note Q]]
- [ ] 1998-03-06 add this feature_f #Test/d06
- [ ] 1998-73-07 add this feature_g #Test/d07
- [ ] 1998-03-08 add this feature_h [[Note P]] , [[Note Q]]
- [ ] 1998-03-09 add this feature_i
- [ ] 1998-03-10 add this feature_j
- [ ] It is finished!
04
filename : dic_19980401
---
Date: 1998-04-01
---
## input
### main tasks
- [ ] 1998-04-01 add this feature_a #Test/d01 [[Note P]] , [[Note Q]]
- [ ] 1998-04-02 add this feature_b #Test/d02 [[Note P]]
- [ ] 1998-04-03 add this feature_c [[Note Q]]
- [ ] 1998-04-04 add this feature_d #Test/d04
- [x] 1998-04-05 add this feature_e #Test/d05 [[Note Q]]
- [ ] 1998-04-06 add this feature_f #Test/d06
- [ ] 1998-74-07 add this feature_g #Test/d07
- [ ] 1998-04-08 add this feature_h [[Note P]] , [[Note Q]]
- [ ] 1998-04-09 add this feature_i
- [ ] 1998-04-10 add this feature_j
- [ ] It is finished!
05_excluded
filename : dic_19980501
---
Date: 1998-05-01
---
## input
### main tasks
- [ ] 1998-05-01 add this feature_a #Test/d01 [[Note P]] , [[Note Q]]
- [ ] 1998-05-02 add this feature_b #Test/d02 [[Note P]]
- [ ] 1998-05-03 add this feature_c [[Note Q]]
- [ ] 1998-05-04 add this feature_d #Test/d04
- [x] 1998-05-05 add this feature_e #Test/d05 [[Note Q]]
- [ ] 1998-05-06 add this feature_f #Test/d06
- [ ] 1998-75-07 add this feature_g #Test/d07
- [ ] 1998-05-08 add this feature_h [[Note P]] , [[Note Q]]
- [ ] 1998-05-09 add this feature_i
- [ ] 1998-05-10 add this feature_j
- [ ] It is finished! #next
06_excluded
filename : dic_19980601
---
Date: 1998-06-01
---
## input
### main tasks
- [ ] 1998-06-01 add this feature_a #Test/d01 [[Note P]] , [[Note Q]]
- [ ] 1998-06-02 add this feature_b #Test/d02 [[Note P]]
- [ ] 1998-06-03 add this feature_c [[Note Q]]
- [ ] 1998-06-04 add this feature_d #Test/d04
- [x] 1998-06-05 add this feature_e #Test/d05 [[Note Q]]
- [ ] 1998-06-06 add this feature_f #Test/d06
- [ ] 1998-76-07 add this feature_g #Test/d07
- [ ] 1998-06-08 add this feature_h [[Note P]] , [[Note Q]]
- [ ] 1998-06-09 add this feature_i
- [ ] 1998-06-10 add this feature_j #next
- [ ] It is finished! #next
07_excluded
filename : dic_19980701
---
Date: 1998-07-01
---
## input
### main tasks
DQL10_flatten_fLists_and_display_fLinks_only
Summary
Main DQL
Code Name
Data type
Group By
Purposes
Remark
DQL10_flatten_fLists _and_display_fLinks_only
task items
yes
1.To flatten file.lists 2.To gather uncompleted task items 3.To groupBy file.link as G1 4.To filter by uncompleted task items where none item is tagged with #next 5.Omitted: To gather uncompleted task items where any item isn’t tagged with #next 6.To display each G1 as rows.file.link[0]
The DQL10 is based on the DQL90 in the following topic. - Solutions: by Justdoitcc
Notes
Summary
The same codes: to filter by rows.L.tags
To filter the data by rows.L.tags where none rows.L.tags contains “#next”
Original Example10
WHERE none(rows.L.tags,(e) => contains(e, "#next"))
Another Example11
WHERE !any(rows.L.tags,(e) => contains(e, "#next"))
Another Example12
WHERE !filter(rows.L.tags,(e) => contains(e, "#next"))
Code DQL10_flatten_fLists_and_display_fLinks_only
Summary_code
title: DQL10_flatten_fLists_and_display_fLinks_only =>1.To flatten file.lists 2.To gather uncompleted task items 3.To groupBy file.link as G1 4.To filter by uncompleted task items where none item is tagged with \#next 5.Omitted: To gather uncompleted task items where any item isn't tagged with \#next 6.To display each G1 as rows.file.link[0]
collapse: close
icon:
color:
```dataview
LIST WITHOUT ID
rows.file.link[0]
FROM "100_Project/02_dataview/Q13_Tasks/Q13_test_data"
FLATTEN file.lists AS L
WHERE L.task AND !L.completed
GROUP BY file.link AS G1
WHERE none(rows.L.tags,(e) => contains(e, "#next"))
```
1.To groupBy page.file.link as G1 (G1=group.rows) 2.To flatten page.file.lists 3.To filter by uncompleted task items where none item is tagged with #next 4.To gather uncompleted task items where any item isn’t tagged with #next 5.To display each G1 as file.link
The DVJS10 is based on the DVJS90 in the following topic. - Solutions: by Justdoitcc
Wow! This is amazing. I think I get it, I didn’t know you could do this sort of advanced stuff with dataviewjs
Do you have any suggestions for the formatting of the outputs? Right now it seems the results are headings, and they make my list incredibly big I don’t understand where the actual displaying of the list is happening in this code nor how to change it. Marking it as the solution anyways
Edit: I found dv.header() and tried changing it to dv.list()… the result is empty now
Anyways, that was really impressive. I’ve been able to create another two complex filters now that I know I can do such complex operations with objects and loops
Actually, I have a problem, and maybe it’s my fault for not having explained myself correctly, not sure.
Your filter returns ALL notes that have ANY uncompleted tasks not marked as #next. However, I’d like to exclude from the list any file that actually has at least one (uncompleted task marked as #next). In my system, if a project has at least one nextaction, it doesn’t need review. Any idea how to do so?
Oh, I see, you don’t want to see the page at all if there’s any task tagged #next. Is there a reason you don’t just pull all files without a #next anywhere in the file (from that directory)? Are you using #next in one way when it’s used with tasks and another way outside of tasks? If not, just search for untagged files.