Hello! Projects has a structure:
- 01 Projects (foldernote)
- Project 1 (foldernote, #project)
- Subproject 1
- Task 1
- Task 2
- …
- Subproject 1
- …
- …
- …
- …
- Project 1 (foldernote, #project)
I took code from this topic, and now each project note has progress bars showing the progress of each subproject note by task (so cool!).
TABLE WITHOUT ID que as "№",
file.link as "Subproject",
"<progress value='" + Progress + "' max='100'></progress>" AS "Progress"
WHERE contains(file.path, this.file.folder) OR contains(project, this.file.link)
WHERE file != this.file
WHERE file.tasks
FLATTEN (length(filter(file.tasks.completed, (t) => t = true))/length(file.tasks.total)*100) as "Progress"
SORT choice(que, que, 99), Progress DESC
What I’m trying to do
Trying to see the full progress of each project in “01 Projects”.
- Get Project notes with #project tag
- Get all tasks from each folder that contains Project note, includes subfolders
- Show progress bars for each project
Things I’ve tried
Trying to customise code but get confused with grouping and flatting.
The closest I’ve tried (as I think) was this:
TABLE WITHOUT ID que as "№",
Section,
"<progress value='" + Progress + "' max='100'></progress>" AS "Progress"
FROM #project
WHERE contains(file.folder, this.file.folder) OR contains(file.outlinks, this.file.link)
WHERE file != this.file
GROUP BY regexreplace(file.folder, ".*\/([^\/]+)$", "$1") AS Section
FLATTEN (length(filter(sum(rows.file.tasks.completed), (t) => t = true))/length(sum(rows.file.tasks.total))*100) as "Progress"
SORT choice(que, que, 99), Progress DESC
I’d appreciate any help.