Dataview: Querying, Displaying & Organizing Notes by Week they were Created in

What I’m trying to do

I’m using Templater, Periodic Notes along with the Calendar plugin to create pages for Weekly Notes. On the Weekly notes page I want to use Dataview table to show only notes created during that week. The notes to be shown reside in a folder that is not part of the Periodic Notes folder structure. Basically, it’s a separate folder inside my vault. (See screenshot below)

Folder_Structure

Things I have tried

I’ve added the following code inside the Weekly Notes template file, so when a new Weekly Note is created. It will automatically show all notes created during that week.

dataview 
table without id
file.link AS "Entries This Week",
file.day AS "Date", 
Category,
Blank
from "Random Notes"
where file.day <= date({{date:YYYY-MM-DD}}) and file.day >= date({{date:YYYY-MM-DD}}) - dur(7 days)
sort file.link asc

Issue I’m Encountering

The code above is outputting the error below when I switch to Reading view. And on the Weekly Notes page the table is only showing 1 item from the specified folder. But the folder has 6 sample notes, each one has a title in the format YYYY-MM-DD along with a date property. (Screenshot below). What am I missing? Any help is greatly appreciated.

Sample_Note

Dataview: Error: 
-- PARSING FAILED --------------------------------------------------

  5 | Blank
  6 | from "Random Notes"
> 7 | where file.day <= date({{date:YYYY-MM-DD}}) and file.day >= date({{date:YYYY-MM-DD}}) - dur(7 days)
    |                         ^
  8 | sort file.link asc
  9 | 

Expected:

object ('{ a: 1, b: 2 }')

:shushing_face: Anyone got any idea(s) on how to make this work?

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