Hi, I dont even know if this is possible with Dataview, but I’ve been searching and trying different things and cant get it to work.
I have a file called ‘journal’ where I make notes as list items under a 3rd level heading where I write the date. These list items are each tagged to show which project the list item is related to.
I would like to be able to pull a list of all the items in my journal file with a certain tag (lets say ‘PER’) , that ALSO shows the 3rd level heading directly above it - which in my set up would where I have written the date. The output would then need to look something like this:
2022-10-26
#PER note from the list item
#PER note from the list item
#PER note from the list item
2022-10-25
#PER note from the list item
#PER note from the list item
#PER note from the list item
Currently I can only get the list items to display - with no section heading (date) above.
The level of the header is irrelevant. file.lists (as file.tasks) have a lot of metadata associated, as the section.
In DQL you can try something like this:
TABLE WITHOUT ID
link(key, meta(key).subpath) AS Day,
rows.Lists.text AS Content
FROM "folder-path"
WHERE file.lists
FLATTEN file.lists AS Lists
WHERE contains(Lists.tags, "#PER")
GROUP BY Lists.section
if you don’t want the header as a link use only meta(key).subpath AS Day
THANK YOU!!! This works perfectly, especially the DvJS version - exactly how I wished! I would like it to sort in the opposite order, but that’s just a small thing that I can learn to live with.
I don’t know which dvjs version you mention. But to sort by the group (the section/header) I think you can apply this (js isn’t my territory, but I think it works):