Dataview - Query for table to sort data based on file name

Things I have tried

What I’m trying to do

I have a daily note, in this note i have a table created by Data view that table is below and works fine.

	Table WITHOUT ID
		source AS "Ticket",
		EAM AS "EAM Data",
        Tags AS "Tags"
FROM "08 - Ticket Review"
SORT Date ASC
LIMIT 20	

It is as far as I have been able to understand, looking at the metadata below:

date::
type:: ==#TroubleTickets==
source::
Tags::
EAM:: EAM Data

This metadata is within a folder 08 - Ticket Review and each file is created with the date YYYY-MM-DD Ticket Review. (2022-04-12 Ticket Review) i want todays note to review yestedays tickets. The above Table works but it is gathering all ticket data.

I have tried this table:

	Table WITHOUT ID
		source AS "Ticket",
		EAM AS "EAM Data",
        Tags AS "Tags",
        date AS "Date Created"
FROM "08 - Ticket Review"
WHERE date(date) = date(yesterday)
LIMIT 20	

It doesnt give me any parse errors but it also doesnt provide me any ticket data. I’m not sure what I am doing wrong.

Hi @toalg ,

It looks like maybe you’re trying to filter on the fact that the file is named e.g, “2022-04-12 Ticket Review”. Dataview does capture the date from the title, but not in the date field. Instead it’s in the file.day field.

For example, this query listed all the files in my vault that had a date in the title of yesterday:

```dataview
LIST
WHERE file.day = date(yesterday)
```

image

I hope this helps!

Craig

1 Like

As easy as that!!! thank you so much it was driving me crazy at least when i have an error i can work on correcting it. it works as i want it to

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.