Things I have tried
This doesn’t work:
TABLE rows.field_a, rows.field_b, rows.field_c
GROUP BY month
GROUP BY week
I can get the dataviewjs to group once by month but not again by week…
let pages = dv.pages()
let groups = pages.groupBy(p => p.month);
for (let group of groups){
dv.header(2, group.key);
dv.table(["rows.field_a", "rows.field_b", "rows.field_c"],
group.rows
.map(b => [b.field_a, b.field_b, b.field_c])
)
}
What I’m trying to do
Imagine there are a bunch of pages in an obsidian vault with a month::
field and a week::
field.
I want generate a table (or list) in either dataview or dataviewjs that groups notes by month and then by week so that the result (generally speaking) looks like this:
January
Week 1
- table row (or list item) 1
- table row (or list item) 2
- table row (or list item) 3
Week 2
- table row (or list item) 1
- table row (or list item) 2
- table row (or list item) 3
Week 3
- table row (or list item) 1
- table row (or list item) 2
Week 3
- table row (or list item) 1
- table row (or list item) 2
- table row (or list item) 3
- table row (or list item) 4
Week 4
- table row (or list item) 1
February
Week 1
- table row (or list item) 1
Week 2
- table row (or list item) 1
Week 3
- table row (or list item) 1
- table row (or list item) 2
- table row (or list item) 3
Week 3
- table row (or list item) 1
- table row (or list item) 2
- table row (or list item) 3
- table row (or list item) 4
Week 4
- table row (or list item) 1
March
Week 1
- table row (or list item) 1
Week 2
- table row (or list item) 1
Week 3
- table row (or list item) 1
- table row (or list item) 2
- table row (or list item) 3
Week 3
- table row (or list item) 1
- table row (or list item) 2
- table row (or list item) 3
- table row (or list item) 4
Week 4
- table row (or list item) 1
April
(pattern continues as you would expect… Month headers are followed by week headers, inside of which are nested table rows or list items…)