But you don’t show us any query!
We can’t guess the used commands/functions.
You can use multiple values in fields, but you need to use the right functions in the query. For example, in type = "value 1" equal means equal, not part of… So, if in type you use multiple values, then you need to use another way, because you have a list of values and need to check if it contains one of the values: for example WHERE contains(type, "value 1").
Another question is related with dates! In your example you have links, not dates!
Thank you for the tips. I have had a look at the files and the query, and I think I understand what is happening but not how to fix it.
With a few files, it all works fine in terms of being able to see both dates in the query—exactly as in your screenshot—and all the files listed.
I said in the first post that with two dates the film disappears from the query. I removed the LIMIT 50 and when the query loaded all 898 films, I saw the one with the two DateWatched values listed at the end of the query. I think this means that the DateWatched for that file isn’t being sorted with the films that have only one DateWatched value. If I add a second date to a DateWatched value for any other film, the film immediately drops to the bottom of the query table.
And, yes, all the DateWatched values point to files that exist in my journal. I watch a film, write it down in my journal, and then create a new file for the film.
You can see in the sample files attached that the DateWatched value isn’t calculated for ‘Glass Onion’ with its two values.
It seems likely that sorting on dates vs an array of dates will get you into some issues. You might resolve some of them by doing a min(DateWatched) or max(DateWatched) (untested, just a theory presentation) to select which of the dates you want for your sorting.
To start, related to the code itself, you don’t need choice(typeof(DateWatched) = "array", DateWatched, list(DateWatched)) AS When
just DateWatched AS When.
But I guess you use that expression for “style” purposes (to see all values as a list… I’m using Minimal, I don’t have that problem, because there’s no “-” in dataview tables).
About the sorting thing, @holroy is right about the max() or min(). (We don’t know if, when multiple dates, you want to prioritize the last or the first.)
But the point is: you can’t do that directly with the links! Links aren’t dates:
If you ask to max() or min() of links, you get an answer related with alphabetic order;
if you ask to sort a link, you get a sorting related with alphabetic order of the file path (link is a path)
So, you need to play with dates. To do that, if the “date” files exist, then you need to go through the link and target an implicit date value in that link. Using, for example, file.day.
Takker og bukker, holroy, and muito obrigado, mnvwvnm.
I read the help pages for max and min and for file.day and now understand what is happening with the query, although I would never have managed to put the jigsaw parts together without the kindness of you two sharing your time and knowledge. Very grateful.
Yes, the choice(typeof(DateWatched) line is used so that bullet points are used consistently. I run Obsidian with the default theme, just to keep things as simple as possible for me.
Thanks for the neat tip about the option to use Flatten—that will come in very useful if I do want to see the dates separately.