I’m trying to create a dataview table that shows all the notes I have created that week
I’ve already managed to create a dataview table that shows “Created” and “Last Modified” for daily notes, but now I want to do the same for Weekly (and then Monthly) notes.
This is the code I have for my daily one:
[!example]- Created Today
TABLE file.ctime as "Created"
FROM "Notes"
SORT file.ctime DESC
(if anyone knows how I can add an extra column to show the folder the note is in, that would also be appreciated)
and I have this one for modified daily:
[!example]- Modified Today
TABLE file.mtime as "Last Modified"
FROM "Notes"
SORT file.mtime DESC
These work for my daily notes, but I cannot figure out how to use them for my weekly and monthly. I’ve tried so many date formats, using templater date formats, looking in this forum, even google searches - every code I have tried has come up with the “PARSING VIEW” error.
Is there a way I can use this code but tweak it a bit to show my weekly and monthly created and modified dates? I am so new to Obsidian and using dataview that I have no idea what could be wrong!
Any help would be incredibly appreciated! (and I hope I’ve explained everything correctly!)
To help people help you you should list some examples on weekly and monthly files, and which format the file name are in, and whether you’ve got any extra information in the daily note stating which date it is. Like do you have the date field set in an ISO8601 format, or some custom format of your own?
If you add just file to a table, you see all the information related to that given file. You would then also see that file.folder shows the folder of that file, and that file.path would show the file name and the folder. And much more information.
Hmm. The queries you posted aren’t going to show only the notes created (or modified) on the day of your daily note. They’re going to show every note in the folder “Notes”, just sorted in a different order. Is that what you meant to do?
This might get you started on what I think you’re trying to do; it’s a query you can put in your daily note to show all notes—from your entire vault—that were created that day:
```dataview
TABLE file.ctime AS "Created", file.folder AS "Folder"
WHERE dateformat(file.ctime, "y M d") = dateformat(date(this.file.name, "cccc-dd-MMMM-yyyy"), "y M d")
SORT file.ctime DESC
```
That’s based on your screenshot and assuming you fully spell out the month in the daily note name. But if your months are written with just the first three letters, then delete one of the capital "M"s in my date format.
To limit that to notes from a specific folder, put your FROM "my-folder-name" statement in there again.
And if that doesn’t work, then share more info about your note and folder structure, like holroy mentioned.
(edit: changed my incomplete month-based example to be a daily example that might be more helpful for adapting to monthly and yearly)