Dataview (or dvjs or datacore?) list of watched films by date incl multiple watches

The thing is…

For each one of my 14,000 film pages, I maintain a Viewing History section, under which I keep track of when the film was watched and with who, my rating, and my review. It’s all done with double colons (::) in keeping with dataview, like this:

Example: '2001: A Space Odyssey' because of multiple watches
# Viewing History
## watched:: 2023-01-11
who:: nick and stu

## watched:: 2021-01-12
who:: nick and Lou for Hal's Birthday
myrating:: 4

## watched:: 2016-01-12
who:: nick and Jim

I have never known how to create a decent list of all viewed films, in descending order, that was able to deal with multiple viewings. I don’t want to have to enumerate and/or get into a bunch of if thens, with watched[0], watched[1], watched[2], etc.


What I want (really really want)

(that Stanley Cup playoffs commerical is getting to me)

a table like this...
watched title who my rating
2026-05-02 Junebug nick and stu 3.5
2026-05-01 2001 A Space Odyssey nick and stu and terry 4.5
2026-04-24 Viva Las Vegas nick and mary 2
2026-04-22 2001 A Space Odyssey nick and charley 4.5

… or a comma separated list like this (which is preferable, actually, as it is easier to read when opening an md file outside of obsidian).

2026-05-02, Junebug, nick and stu
2026-05-01, 2001 A Space Odyssey, nick and stu and terry

:triangular_flag: The important thing is to have the various re-watches listed as individual watches (rows) in descending order, and if at all possible, output as a md table/list so that I can see info rather than code when opening the md file outside of Obsidian.


What I’ve Tried

Tried this dvjs code:

const pages = dv.pages("#filmtitle or #short or #tvtitle")
.where(p => p.watched && p.watched.year == '2022' && p.watched.month == '07')
.sort(p => p.watched, 'desc');
dv.table(["file", "watched"], pages.map(f => [f.file.link, f.watched]));
    
See Results: doesn't include rewatches

I watched 2001 on Jan 14 and it doesn’t appear on this list because it is a rewatch, so not watched[0] .

I also tried this:

TABLE WITHOUT ID "[[" + title + "]]" as "Film", watched as "Viewing Date", who as "watched with"
from "Films" or "Films not in collection"
WHere watched != null
limit 25
sort watched DESC
Result: This came close but includes all rewatches in one block

Conclusion

I’ve tried too many things in the past 5 years to list here. Needless to say, none worked.

Maybe I should give up on Dataview(and js), and give it a shot with Datacore? I read that it can do things with headings… and maybe that’s the way to do this given that each of my watched dates is a heading: ## watched:: 2025-09-12

Personally I would rather not depend on them being headings so if I could get dataview and/or dvjs to work, that would be fantastic.

TABLE WITHOUT ID "[[" + title + "]]" as "Film", watched as "Viewing Date", who as "watched with"
from "Films" or "Films not in collection"
WHere watched != null
limit 25
FLATTEN watched
sort watched DESC

You need FLATTEN

1 Like

Thanks so much. That almost works.
I mean it definitely works for the watched part.
I’m getting the various watched dates of the same film on a single row, which is perfect.
What isn’t so great is that each of those rows include all of the “who” details every time.

screenshot

I tried to slip in another Flatten for the who field but that didn’t work

TABLE WITHOUT ID “[[” + title + “]]” as “Film”, watched as “Viewing Date”, who as “watched with”
from “Films” or “Films not in collection”
WHere watched != null
limit 25
FLATTEN watched
:right_arrow: FLATTEN who :left_arrow:
sort watched DESC

results

Basically it combines all of the “who” values like in the previous example, but instead of lumping them all together for each date, it just duplicates the viewing date for each of the total ‘who’ values., instead of showing who viewed on this date, and who viewed on that date.

Your goal is out from DQL abilities. I don’t know how to rewrite your query into js. In fact comlicated things like data querying with fields concatenation (that’s what you want in my mind) are motivation for personal deep research of the tool (dataview now) and understanding how to compromise between your wishes and tool features.

Although I would recommend modifying the data structure to eliminate the necessity of concatenating this list into a single string, as well as removing duplicates. Consequently, the output may appear satisfactory even without overcomplicating the query.