I ran across this post Dataview query for all tasks in folder with custom status where holroy provided an amazing solution. However, I’ve been attempting to simplify to just show “Count,” and the progress bars.
What I’m trying to do
I initially was looking for something where I could view weekly notes and daily notes’ uncompleted tasks from the past week filtering using my metadata of “week” and “year.”
But realized that the previous mentioned forum post was looking all a folder, and for me is not returning all uncompleted tasks (so it seems). It would be more practical for me to have this by file not folder. Also, that I needed to just simplify this for my needs. A uncompleted tasks bar and a completed tasks bar, maybe somehow to include the count within the bar(s) would awesome! Unfortunately, that’s where my capabilities fall very short.
Things I have tried
I’ve attempted to do the below but without success.
Here’s my current code, when I try to reposition the uncompleted bar below the completed bar using
it errors.
TABLE without id file.link + "<br>" + "<progress value='" + (CompleteCount * 100) / Count + "' max='100' />" as "Completed Progress", Count, UncompleteCount as UnC, CompleteCount as C,
"<progress value='" + (UncompleteCount * 100 ) / Count + "' max='100' />" as "Uncompleted Progress"
FROM "Work"
FLATTEN file.lists as item
WHERE item.task and contains(list(" ", "/", "-", "x"), item.status)
WHERE year = "2024"
GROUP BY file.folder
FLATTEN length(rows.item.text) as Count
FLATTEN length(filter(rows.item.status, (s) => s = " ")) as Open
FLATTEN length(filter(rows.item.status, (s) => s = "/")) as InProgress
FLATTEN length(filter(rows.item.status, (s) => s = "x")) as Complete
FLATTEN length(filter(rows.item.status, (s) => s = "-")) as Canceled
FLATTEN Open + InProgress + Canceled as UncompleteCount
FLATTEN Complete as CompleteCount