Need help using templater formulas for periodic notes querying habits

Ah, I think we have a different setup after all. I don’t store habits inside the weekly note, only the dailies, so I don’t need to access the weekly note from the dailies. I think I misunderstood your problem.

You should be able to get “2023-W18” by escaping the W, like this: = dateformat(date(this.file.name), "yyyy-'W'WW")