With these kind of values you’ve got a few issues, making your queries somewhat harder to execute.
Issues related to your chosen format
First of all, these values are all just strings, and not links nor lists of various values. In order to make them a list you would need for them to be in the format
[2023-Q4, 2023-Q1, 2023-Q2]. This also includes the single values of
If you opt to not changing into values, you’ll need to use a looser string match to achieve your gaols.
Secondly, that is a lot of various date formats, and I actually your best bet is to convert your current date (from your weekly ( or daily) note) into each of the possible target values. So for example just now you need to generate the variants;
2023-W01, 2023-01, 2023-01-01, 2023-Q1, and then check for either of those four values in your queries. (You might also have to tweak your string checks, as the month variant can be a prefix of the given day variant causing some issues.)
Thirdly, if you’re in a weekly note, you’d either have to generate matching cases for each of that weeks days, or you must loosen the date restriction into a week match (for the match purposes) if the
topPriority is a given day. Somewhat tricky, but doable since in this case the
topPriority is an actual date, which is easily converted and formatted to match a weekly format.
Finally, you would also need to just make sure that if the
topPriority is empty, it doesn’t cause any issue. This shouldn’t be a big one, though.
Is this still doable?
Within an ordinary dataview query? It’ll get hairy, very fast. Maybe doable, but it’ll require some trickery with
FLATTEN to generate the various options, and not sure if one has to generate all seven days of the week.
And it’ll be a rather large query, I imagine.
Generate a DataviewJS roughly following this pseudocode:
Generate a list of nodes having a
topPriority with a value
Based on the note name generate the four (or more) variants of date strings to match
Loop on all the topPriorities notes
- Split the priority on the comma and spaces, …
- … and match against the variants
- If found, add the note to the
If needed, then sort the list
One thing I’m still unsure of is whether you want this from weekly notes, and/or only daily notes? (And what is your name format for these notes? )