Dataview Table: Return A Single File Multiple Times In Table

Hi All,
I’m pretty new to the Dataview plugin. I’ve spent time trying to research this and implement ideas from previous posts on the forum, but wasn’t able to find the solution. Sorry if I’ve missed it.

What I’m trying to do

I want to use a dataview table to show a list of upcoming lecture dates. I have specific page for each lecture topic that contains my notes, etc. On each page, I was planning to use a property to enter the date of a lecture, and another to enter the location of a lecture. In some cases, I have one lecture topic scheduled for multiple events in the future, on different dates in different locations.
I want a dataview table to show a list of my upcoming schedule of lectures by date. Sorted from nearest to most distant in the future.

Things I have tried

When a lecture only has a single upcoming event, the table pulls that page in. However, I don’t know how to make a dataview table return one page multiple times on a table.

I’ve created this set of 3 lecture pages and another page to contain the data view table. For lectures #1 and #2, there is only one upcoming event. Lecture #3 is scheduled for 3 upcoming events.
I understand that what I have would create a conflict and it’s not surprising that it doesn’t work. But, I’m confident that my overall goal is possible in some way.
What possible solutions are there for Lecture #3 to show up 3 times on the dataview table based on the respective dates?

Hopefully I’ve explained the intent clear enough.
Open to suggestions on how to accomplish the same thing in a different approach.
Thanks so much for your help :slight_smile:

An explanation first. Then a proposed solution.


Current structure

This is a challenging query with Dataview, and you had the right instincts about having a problem with three events for one topic. But that actually would lead to too many results, not too few. A different culprit is limiting your results.

Topic 3 is excluded from your results because your WHERE statement relies on having dates. In the first two notes, confirmeddate is a date, and the check is true. But in the third note, confirmeddate is a list. The check:

is a list >= today’s date?

… is false. Dates and lists are different things. To get individual items, you can flatten the list:

FLATTEN confirmeddate AS d

… then compare each item to today’s date:

WHERE d >= date(today)

That gives your table the dates and lecture topics you’re looking for.

But here, you (or really, I, because I couldn’t figure it out either) encounter the multiple events issue. Any lecture topic could have two lists—confirmeddate and confirmedlocation—with an unspecified number of items. The only way that I can think to pair them up is by their order of appearance. That is, date[2] goes with location[2], date[3] goes with location[3], etc. I don’t know what order Dataview reads and stores info; it seems to be in order of appearance, but I wouldn’t rely on that without knowing for sure. Also, the unknown and prospectively large list size would make pairing the items unwieldy if even possible.

Without pairing dates to locations, your table will display all date-location combinations per topic. In your example, I believe that will be 11 results when you’re trying to get 5.

(But maybe someone else reading this knows a way to group them to get the result you want!)

All of this is to set up a different structure for you to consider.


New structure

Make individual event notes, each with a date, location, and link to the topic:

confirmeddate::2025-11-09
confirmedlocation::Atlanta
topic::[[Lecture Topic 1 - Cars]]

Put this in your topic note to automatically display every lecture on that topic:

```dataview
list where topic = this.file.link
```

Use this Dataview table to display your upcoming lectures:

```dataview
TABLE WITHOUT ID t AS Topic, l AS Location, d AS Date, c AS Countdown
FLATTEN confirmeddate AS d
WHERE d >= date(today)
FLATTEN d - date(today) AS c
FLATTEN confirmedlocation AS l
FLATTEN topic AS t
SORT d ASC
```

Result:

Markdown:

A better structure for combining information on multiple lectures in a given note is to use lists:

- [confirmeddate:: 2025-04-10] [confirmedlocation:: Los Angeles]
- [confirmeddate:: 2025-05-10] [confirmedlocation:: Lisbon]

You could also consider using either a decorated task or list item to make these list items stand out a little more.

In either case these will be easier to query since now the date and location is on the same logical unit, a list item. As opposed to having two disconnected parts in the page context.

You for query these using something like:

```dataview 
TABLE item.confirmeddate as Date, item.confirmedlocation as Location, (item.confirmeddate - date(today)) as countdown 
WHERE confirmeddate
FLATTEN file.lists as item
WHERE item.confirmeddate
  AND item.confirmeddate > date(today)
SORT item.confirmeddate DESC 
```
2 Likes

Scaldo,

What holroy said :point_up_2::point_up_2:

Use lists!


holroy,

Do you know whether, in general, a property’s list values will always be in the same order that they appeared within the note, when the properties are inline?

[key::value1]

Lorem ipsum

[key::value2]

Lorem ipsum

[key::value3]

Will the order of key be [value1, value 2, value 3] for sure?

In general they should be in the same order. But the main pitfall against using multiple unconnected fields like the OP originally did, is that if you omit one of the fields (or make a typo) anywhere in the file the rest of the list are skewed.


[confirmeddate:: 2025-04-10] [confirmedlocation:: Los Angeles]

... more text ...

[confirmeddate:: 2025-04-11] [confirmedlocation:: Los Bahia]

... more text ...

[conflrmeddate:: 2025-04-12] [confirmedlocation:: Los Carlos]

... more text...

[confirmeddate:: 2025-04-13] [confirmedIocation:: Los Dos]

Using your earlier solution this would produce this table

Date Location
2025-04-10 Los Angeles
2025-04-11 Los Bahia
2025-04-14 Los Carlos

Notice how the third date has the typo of l instead of i, and even worse how the last location uses a capital i instead of lowercase L. This results in both lists to miss one entry, and the table presents three items where the last line in the table is actually a combination of the v last two entries…

Thank you!

And yeah, I had that typo concern but glossed over it because I was planning to suggest multi-note all along. (didn’t think of lists)

Thank you so much dawni and holroy!
Super appreciative of your help and problem solving.

dawni, your initial solution of creating a new page for each event makes a lot of sense and even has some added benefits, such as being able to schedule an event when the lecture topic isn’t confirmed yet.

holroy, I loved learning that using a list keeps the properties on each item associated. This is a great solution. It feels a little clunky to type out on each page, but is ultimately the solution I was trying to figure out. Valuable to see your example of how other methods could break.

I’ve had good success so far testing out both for my use case. Really appreciate you both taking the time to explain and help :slight_smile: .

1 Like