I have a number of files with metadata like this:
qualification: BA (Hons) Interior Design
level: [4,5,6]
cssClasses: [embed-strict]
registrations:
- {year: 2021, regs: 20}
- {year: 2022, regs: 24}
I am trying to construct a Dataviewjs table query, to create a table like:
Year (groupBy)
Qualification | Programme | Registrations |
---|---|---|
file.qualification | file.name | file.regs |
My problem is that I cannot seem to figure out how I can construct the dataviewjs query to access the year and regs variables from within the registrations
array.
Here’s what I have so far:
dv.table(
["Qualification","Programme","Registrationa"],
dv.pages('"Programmes"')
.where(f => f.qualification == dv.current().file.name)
.sort(f => f.file.name)
.map(f => [f.qualification,f.file.link,f.registrations])
)
This results in:
Qualification | Programme | Registrations |
---|---|---|
BA (Hons) Interior Design | BA (Hons) Interior Design Y1 | year: 2021 regs: 20 |
I cannot see how to get year
and regs
within a .map
or to use in a groupBy
.
Any help greatly appreciated.
Thanks