Filtered list not showing metadata with two dates

Things I have tried

Hi, I’m having a similar problem to this post

What I’m trying to do

I have logged movies that I watched last year. I created one note for every movie, but I want to show them in another note listing movies that I watched in 2022.

I wrote the following dataview query:

TABLE
	Ano,
	Assistido,
	Letterboxd,
	Nota 
FROM
	"04 - Filmes/02 - Filmes"
WHERE 
	Assistido >= date(2022-01-01) AND Assistido <= date(2022-12-31)
SORT
	Assistido
	ASC

Where “Assistido” is “DateWatched”.

The thing is, I watched “Avatar” in two separate dates, so the metadata looks like this:


Ano: 2009
Assistido: 2022-12-19, 2009-12-18
Letterboxd: URL
Nota: 4
Reassisti: true
Tags: media/filme, origem/streamming/disney+

If I remove the WHERE function that filters only the movies that I watched in 2022, Avatar shows up with both dates.

Is there a way to filter and still shows Avatar?

Did you try any of the tips in the other thread? It does seem to be the same case of a single value turning into a list, which throws off your search cases.

In your case it does seem like you want to keep both films in list, so I would suggest to use FLATTEN transform those two values for Assistido which are present in one row for Avatar, into two rows of Avatar with one value each for Assistido.

To fully get this please execute the following query:

```dataview
TABLE
	Ano,
	Assistido
FROM
	"04 - Filmes/02 - Filmes"
WHERE
    file.name = "Avatar"
```

and

```dataview
TABLE
	Ano,
	A
FROM
	"04 - Filmes/02 - Filmes"
FLATTEN
    Assistido as A
WHERE
    file.name = "Avatar"
```

One of them contains the key to what you need to change your full query to, as well. :smiley:

Hope this helps, and you understand a little bit on how FLATTEN works. You are free to change A to whatever you like. I chose A since I don’t know any good alternatives to Assistido.

Bonus tip 1: Try changing the Assistido in the first query to min(Assistido) and/or max(Assistido) and see the effect of it.

Bonus tip 2: If you add another set of backticks around dataview-queries (or other code blocks) with ```` on the lines before and after, it’ll show as a proper code block in the forum question.

Hi!

Thanks for replying so fast!

Well, I tried the tips from the other thread, but it didn’t help.

The thing is, I don’t want to show “2009-12-18” for Avatar in my query. Just the date that I watched last year.

I tried using min(Assistido) and max(Assistido) both at WHERE and SORT, but the problem is that I can’t filter it.

I’ll try FLATTEN as well.

Thanks for the tips. It’s my first time here.

1 Like