Dataview - Code for more than 1 year

I am not very good with dataview and codes. I tried duck.ai for help. But without success. I want the dataview code working for not only the year 2024 (as mentioned below), but for example for 3 years. (i have my vault structured as: YYYY/MM/YYYY-MM-DD).

What I’m trying to do

TABLE rows.L.text AS "Gebeurtenissen"
FROM "01-JOURNALEN/11-Journalen/2024"
FLATTEN file.lists AS L
WHERE meta(L.section).subpath = "Gebeurtenissen"
GROUP BY file.link
SORT file.link

Has someone a possible solution for me?

regards, Michel

I am sorry but I cannot do more than a minute on this as I don’t have your file structure, etc.
But I am pretty sure 2025 bot help is good about DV.

I asked two questions and the bot’s second attempt may be good enough to go on (that is as if I understood the request properly):

1 Like

To include all of your journal subfolders, you can simply remove the year from your FROM statement:

FROM "01-JOURNALEN/11-Journalen"

To do select years, this is one way:

FROM "01-JOURNALEN/11-Journalen/2023" OR
    "01-JOURNALEN/11-Journalen/2024" OR
    "01-JOURNALEN/11-Journalen/2025"
1 Like

Yeah, that is the OR I intended.

Sometimes I see YT tutorials where the creator copy pastes 10-20 instances of much the same thing because they do not know regex.
I think it was you who posted a regex usage example for Bases too. Thanks

1 Like

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