Create dataview table for tasks by section header?

What I’m trying to do

I’m studying for med school and am trying to generate an auto-tracker for the videos I’m watching. Each obsidian page is a section of videos, and each individual video is a header in that page (followed by notes). I’m trying to make a table in dataview that looks something like this:

Section Incomplete Videos Complete Videos
Genetics 5 Genetics 5.1 Genetics 5.3
Genetics 5.2
Microbiology 6 Microbiology 6.1

Basically where Column 1 is the obsidian page, and columns 2 and 3 are the headers associated with the checkboxes.

Things I have tried

TABLE file.folder AS "Subject", file.link, choice(file.tasks.completed, file.tasks.link, "") AS "Complete Videos", choice(file.tasks.completed, "" , file.tasks.section) AS "Incomplete Videos", file.tasks
FROM "Step 1"
WHERE length(file.tasks) > 0 AND contains(file.tasks.Course, "KF")

However, this seems to generate a bullet point for each header and within that, checks for all checkboxes in the page that are complete/incomplete and repeats for each header. I’m realizing the checkboxes are not inherently tied to a header, just a page. Is there any way to do this simply? (I’m a beginner at this kind of work, and am still adjusting to the volume of studying in med school). I’m happy with a dataview task version instead if that works better. I would create an obsidian page for each video instead of just a header, but because each video varies from 3 minutes to 20, headers are simply my best option for cohesiveness. Thanks so much, would really appreciate any help!

Whoops I tried messing around with it after I posted this and realized the issue is that for each complete/incomplete checkbox it simply lists out all the headers instead of its own file.tasks.section, how can I get it to say only its specific header?

I figured it out!

TABLE WITHOUT ID regexreplace(file.folder, ".*\/([^\/]+)$", "$1") AS "Chapter", file.link AS "Section", 
list(filter(file.tasks, (t) => t.completed AND contains(t.Course, "KF W2"))).section AS "Complete",
list(filter(file.tasks, (t) => !t.completed AND contains(t.Course, "KF W2"))).section AS "Incomplete"
WHERE file.tasks AND contains(file.tasks.Course, "KF W2")

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