# Dynamic filter data by timeframes doesn't work

**URL:** <https://community.glideapps.com/t/dynamic-filter-data-by-timeframes-doesnt-work/75593>\
**Category:** Ask for Help\
**Created:** [August 11, 2024, 5:59pm UTC](https://community.glideapps.com/t/dynamic-filter-data-by-timeframes-doesnt-work/75593 "2024-08-11T17:59:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lavaboom](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lavaboom/32/78541_2.png) [@lavaboom](https://community.glideapps.com/u/lavaboom)\
**Post date:** [August 11, 2024, 5:59pm UTC](https://community.glideapps.com/t/dynamic-filter-data-by-timeframes-doesnt-work/75593/1 "2024-08-11T17:59:49Z")

</div>

I’m looking to display expenses based on these timeframes: Today, This Month, This Year (based on this tutorial [https://www.youtube.com/watch?v=pApLeMYHFzE](https://www.youtube.com/watch?v=pApLeMYHFzE)).

Here are my expenses data table and Work data table

Expenses data table

 ![Screen Shot 2024-08-11 at 1.53.02 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/d/bd634d311c1b14f4e5d569bb1239ecfb00236c76.png)  
 ![Screen Shot 2024-08-11 at 1.53.16 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/f/af3e4c95ae0f5545d3e3d190f0652d1b6277ee5e.png)

Work data table

 ![Screen Shot 2024-08-11 at 1.53.27 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/2/92eb2e8ff7abca36826a55a1af5afe16fb41ed60.png)  
 ![Screen Shot 2024-08-11 at 1.53.33 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/f/2f174677991207edc859bab67792cc86def8fda9.png)  
 ![Screen Shot 2024-08-11 at 1.53.41 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/7/f7261b8b91f28fc6c98073be396a836e9044cc26.png)

I already created a rel\_expense column that relates the input This Month, This Year, etc. to the timeFrame array storing month, year, week, etc. of the expense date.

On my layout, when I select “This Month”, the output returned is correct

 ![Screen Shot 2024-08-11 at 1.56.51 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/6/46da8865297305c3bf7399ebd75590bb0ada8790.png)

But it is blank/not correct when I select “This Year” or “This Week”,

 ![Screen Shot 2024-08-11 at 1.57.03 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/7/278f37dae5528edeca352b93f857c86f77bddfef.png)  
 ![Screen Shot 2024-08-11 at 1.57.09 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/5/a58c4fd95aa0cc9b043bd79c4c279d41d222fd7b.png)

Any idea what issue I might be encountering? Thanks!

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [August 11, 2024, 6:24pm UTC](https://community.glideapps.com/t/dynamic-filter-data-by-timeframes-doesnt-work/75593/2 "2024-08-11T18:24:47Z")

</div>

Hola Thuy!

Just a curiosity:

Why does your “Timeframe value” column have a static value (text) instead of a number?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/7/a73ed752f4ae75bcd6ee6c8b5582ba52c7efb6a7.png)

Something strange is doing your choice component (I think).

Bye bye

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [August 11, 2024, 11:32pm UTC](https://community.glideapps.com/t/dynamic-filter-data-by-timeframes-doesnt-work/75593/3 "2024-08-11T23:32:29Z")

</div>

I think if you have User Profiles setup, you can have:

- A user-specific column to store whether the user wants to view “This Week”, “This Month” or “This Year”.
- Craft computed columns to calculate each corresponding time frame’s numbers.
- Show/hide components based on what the user wants to view.
