Dataview: How to display only the year of creation in a table?

What I’m trying to do

Hello! I am trying to create a Dataview table that will list me the pages containing the most words from year 2023 only.

Here are the properties:

date_created: JJ/MM/YYYYY
date_modified: JJ/MM/YYYYY
est-Chars: number
est-Words: number

Properties help me track the creation date of a page (sometimes I create a blank page for later as a reminder, I do not consider it the real creation date so I need to track it) and the modification date (by “modification” I mean the last real impact on the page, not just correcting a typo).

Things I have tried

I’ve spent quite a while on the forum and online, but I did not find a Dataview query that could me achieve that. Here is my try at this, it is incomplete as I can’t edit “date_created” into a query meaning “2023 only” :

TABLE est-Words, est-Chars, date_created AS "2023"
SORT est-Words DESC

Thanks for any help!

Could not find a way to edit the original post so I’ll just add this here:
The date format has been changed to YYYY-MM-DD
(The JJ meant DD in another language)

Hi! Having a note with:

date_created: 2023-12-01
est-Chars: 100
est-Words: 10

We can use:

TABLE est-Words, est-Chars, date_created AS "2023"
WHERE date_created.year = date(today).year```

And we will get:

|File      |est-Words |est-Chars |2023             |
|Note      |10        |100       |December 01, 2023|

You can also hard-code the date:

WHERE date_created.year = 2023
1 Like

Hi sanyaissues, thanks very much it works!!

Just need to add SORT est-Words DESC to your solution (to have the highest numbers on top of the 2023 table) and it’s perfect. Have a nice day

1 Like

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