I’m trying to visualize all previous meetings and projects associated with the attendee in a series of meeting in the current year.
In the person note ( attendee)
I have created a dataview query for listing all the previous meetings which the person has attended.
IN the meeting note, I have Attendeesas an inline field.
Attendees:: [[John]]
Projects:: [[XYZ installation]]
I would like to get the output only for the current year 2024 and not for previous year 2023.
date: 2024-05-01
tags: Meeting
I have “date” in the format “YYYY-MM-DD” in YAML in the meeting note. I would like to derive the year ‘YYYY’ from the meeting note date and use this year to filter the dataview query for the previous meetings attended by John.
the meeting note also contains " Projects" inline field where John is working on.
For example: if John has attended 2 meetings in Dec 2023, 3 meetings in Jan 2024 and 1 meeting in Feb 2024, I would llike to see the output for only the 4 meetings in 2024.
I tried to use the WHERE command without much success to filter the year.
Things I have tried
TABLE file.cday as Date, purpose as "Purpose"
FROM "Meeting"
WHERE contains(file.outlinks, [[John]])
where file.day != null and file.day.year != null and file.day.year = date("YYYY").year()
SORT file.cday DESC
I also tried WHERE file.day.year = 2024, it works. However I donot want to hard code the year in my person note template, to avoid maintenance every year.
How to filter using the WHERE command to get the 2024 meetings from the meeting note, rather than all years?
I could not find anything matching this request in the Help section.
Thank you @holroy. I tried with the WHERE command suggested by you:
Below is the dataview query which I use
TABLE file.cday as Date, purpose as "Purpose"
FROM "Meeting"
WHERE contains(file.outlinks, [[John]])
WHERE dateformat(date(today), "YYYY") = dateformat(file.day, "YYYY")
SORT file.cday DESC
Result is that John’s two meetings in 2023 also gets picked up. I suppose this is beacuse the file.day (for the meetings) has dates originating in 2023 ??
I wanted the result to show only meeting notes in 2024.
In your table your listing file.cday which refers to the creation date of that note, but the where clause uses file.day which refers to the date in the file name or the date property. The where clause should work, so try to add/change to file.day in the table output and see what happens then.
TABLE file.day as Date, purpose as "Purpose"
FROM "Meeting"
WHERE contains(file.outlinks, [[John]])
WHERE dateformat(date(today), "YYYY") = dateformat(file.day, "YYYY")
SORT file.day DESC
‘date’ which is the date property in 2024 meeting notes with ‘YYYY-MM-DD’.
Whereas 2023 meeting notes contains ‘Created’ as the date property with ‘YYYY-MM-DDTHH:mm’
TABLE date as Date, purpose as "Purpose"
FROM "Meeting"
WHERE contains(file.outlinks, [[John]])
WHERE dateformat(date(today), "YYYY") = dateformat(date, "YYYY")
SORT file.day DESC
Could you give a few examples of some meeting notes with name and date and/or Created propertys related to “John”? We’re miscommunicating somehow, so we need to some example notes.
2024 meetings with “John”
In Meetings folder the following meeting notes are available ( as an example):
YAML contains date and note has inline filed for purpose.
date purpose
2024-01-15 Weekly Sync
2024-01-21 Annual review
2024-01-28 Project Review
2024-02-06. Weekly sync
2023 meetings with “John”
date purpose
2023-12-08. code review
2023-12-22. weekly sync
The dataview query in John ( Person) note yields all 6 meeting note entries. I expect only 4 entries from 2024.
TABLE date as Date, purpose as "Purpose"
FROM "Meeting"
WHERE contains(file.outlinks, [[John]])
WHERE dateformat(date(today), "YYYY") = dateformat(date, "YYYY")
SORT file.day DESC
Ehh… I just realised that you’re using the wrong tokens to format your date with. ‘dateformat()’ uses the Luxon tokens, not the moment.js tokens you’ve used and which are used many other places. So try the following:
```dataview
TABLE file.day as Date, purpose as "Purpose"
FROM "Meeting"
WHERE contains(file.outlinks, [[John]])
WHERE dateformat(date(today), "yyyy") = dateformat(file.day, "yyyy")
SORT file.day DESC
```
Update: Made a typo and forgot the dateformat( in front of the file.day... part.
Sorry, a little copy-and-paste error happening there. I’m going to update it, but you’re quite correct that it should include a dateformat( on the righthand side.