What I’m trying to do
I build book database using dataview and metadata fields. In this schema I use field “date” which contains date or dates when I have read given book. It happens that some books have bean read more than once.
I try to build a neat table containing each year in 1st column and the number of books I’ve read during that year in 2nd column, possibly also further columns containing sum of pages read during the year and so on.
However, I’m unable to construct a query that will enable me to sum the books that have been read more than once.
For reference — the metadata field I use to write the date looks like this date:: 2022-02-23, 2023-06-23
.
Things I have tried
I have looked through the topics with grouping problems, but the best solution I have been able to come with is this:
table length(rows) as count
from "path_to_my_folder"
where date != null
group by date.year as year
Such query results in multiple rows containing each pair of years found, e.g. 2013 and 2021, 2013 and 2022 and displaying counts of books that I’ve read both during these years.
If I change date.year
to date[0].year
obviously it picks only the first time I’ve read a book, but table looks way better.
Thanks for any help.