# Dataview - Code for more than 1 year

**URL:** <https://forum.obsidian.md/t/dataview-code-for-more-than-1-year/108089>\
**Category:** Help\
**Tags:** dataview\
**Created:** [November 17, 2025, 8:23am UTC](https://forum.obsidian.md/t/dataview-code-for-more-than-1-year/108089 "2025-11-17T08:23:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichelSerne](https://forum.obsidian.md/user_avatar/forum.obsidian.md/michelserne/32/33963_2.png) [@MichelSerne](https://forum.obsidian.md/u/MichelSerne)\
**Post date:** [November 17, 2025, 8:23am UTC](https://forum.obsidian.md/t/dataview-code-for-more-than-1-year/108089/1 "2025-11-17T08:23:47Z")

</div>

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

```dataview
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

---

<div class="post-metadata">

**Author:** ![Sunnaq445](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/s/8c91f0/32.png) [@Sunnaq445](https://forum.obsidian.md/u/Sunnaq445)\
**Post date:** [November 17, 2025, 8:12pm UTC](https://forum.obsidian.md/t/dataview-code-for-more-than-1-year/108089/2 "2025-11-17T20:12:19Z")

</div>

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):

> **[ChatGPT - Dataview multiple years query](https://chatgpt.com/share/691b8172-855c-8007-ad11-0cd65c376ccd)**
>
> Shared via ChatGPT

---

<div class="post-metadata">

**Author:** ![dawni](https://forum.obsidian.md/user_avatar/forum.obsidian.md/dawni/32/79261_2.png) [@dawni](https://forum.obsidian.md/u/dawni)\
**Post date:** [November 17, 2025, 8:50pm UTC](https://forum.obsidian.md/t/dataview-code-for-more-than-1-year/108089/3 "2025-11-17T20:50:17Z")

</div>

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

```auto
FROM "01-JOURNALEN/11-Journalen"

```

To do select years, this is one way:

```auto
FROM "01-JOURNALEN/11-Journalen/2023" OR
    "01-JOURNALEN/11-Journalen/2024" OR
    "01-JOURNALEN/11-Journalen/2025"

```

---

<div class="post-metadata">

**Author:** ![Sunnaq445](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/s/8c91f0/32.png) [@Sunnaq445](https://forum.obsidian.md/u/Sunnaq445)\
**Post date:** [November 17, 2025, 9:04pm UTC](https://forum.obsidian.md/t/dataview-code-for-more-than-1-year/108089/4 "2025-11-17T21:04:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [December 15, 2025, 9:05pm UTC](https://forum.obsidian.md/t/dataview-code-for-more-than-1-year/108089/5 "2025-12-15T21:05:26Z")

</div>

Closed on December 15, 2025, 9:05pm UTC

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