# Count / Filter based on current date (year)

**URL:** https://community.glideapps.com/t/count-filter-based-on-current-date-year/73713
**Category:** Ask for Help
**Created:** [May 28, 2024, 12:55pm UTC](https://community.glideapps.com/t/count-filter-based-on-current-date-year/73713 "2024-05-28T12:55:57Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![AxelG](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@AxelG](https://community.glideapps.com/u/AxelG)
#### Post date: [May 28, 2024, 12:55pm UTC](https://community.glideapps.com/t/count-filter-based-on-current-date-year/73713/1 "2024-05-28T12:55:57Z")

</div>

I’m using a session table. There is a start date and a Stop date. I already succeeded in creating the columns I need I beleive . So it is counted and grouped by year (per VISSER (=user) )

 ![Sessies](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/a/3a684c77685c713c69e9a7e412f27b9317d0935c.png)  
 ![jaarsessies](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/9/69aca82420ffd8f4ae5729fe7b6f822e1df481f4.png)  
 ![Count2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/0/4062335df7a5cd63e151cf2b2d376779f0c62cf9.png)  
 ![Count](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/d/dd5120d6e6da50bc4b0eff2c93e0eed7d3cd90fa.png)  
 ![Jaar](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/4/c43c32fcd98a53f9c483991bc38d04dc040e4404.png)

In the screenshot it shows: "Aantal sessies per jaar: 1 " I would like to have there the number counted for the logged user (1 is correct in this case), but i would like this for the current year (So it should show 4). (I could use make visible when the YEAR = 2024, but that should mean that I need to change this each year.

I would also like to use this in the collection, were it should only show sessions from 2024 , (so not the 1st one which is in 2023 …)

---

<div class="post-metadata">

### Author: ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)
#### Post date: [May 28, 2024, 10:54pm UTC](https://community.glideapps.com/t/count-filter-based-on-current-date-year/73713/2 "2024-05-28T22:54:11Z")

</div>

Try to following:

1. Use a query column to query the session table.
2. Notice that you can add a filter in the query column. Point this filter to a basic text column that will house the output of a choice component. That way when the use clicks on the ‘2023’ or ‘2024’ for instance, this value is written the basic column, and the query column changes accordingly.
3. Use the query column as the data source for the collection.
4. Apply a rollup column on the query column if you need to count or determine sums, averages, etc.

---

<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: [May 28, 2024, 11:37pm UTC](https://community.glideapps.com/t/count-filter-based-on-current-date-year/73713/3 "2024-05-28T23:37:00Z")

</div>

So do you always want to show the number of only the current year?

---

<div class="post-metadata">

### Author: ![AxelG](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@AxelG](https://community.glideapps.com/u/AxelG)
#### Post date: [May 29, 2024, 6:59am UTC](https://community.glideapps.com/t/count-filter-based-on-current-date-year/73713/4 "2024-05-29T06:59:55Z")

</div>

Yes indeed.  
Only Current year on that screen.  
PLan to do dashboard like page with overview of other years, but that’s for later 🙂

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [May 29, 2024, 7:08am UTC](https://community.glideapps.com/t/count-filter-based-on-current-date-year/73713/5 "2024-05-29T07:08:56Z")

</div>

Create another Math column similar to your “Jaar” column, but instead of using Date Start as a replacement, use the special “Now” value. This will always return the current year. Then you can filter where current year equals record year.

---

<div class="post-metadata">

### Author: ![AxelG](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@AxelG](https://community.glideapps.com/u/AxelG)
#### Post date: [May 29, 2024, 7:51am UTC](https://community.glideapps.com/t/count-filter-based-on-current-date-year/73713/6 "2024-05-29T07:51:20Z")

</div>

> [@nathanaelb](#):
>
> - query column as the data source for the collection.
> - Apply a rollup column on the query column if you need to count or d

Ok, so I’ve added a CURRENT YEAR COLUMN, Then I do a Query Column to see if the Session year matches the Current rear column;but that doesn’t give me the expected result .  
(eg first row session year is 2023 - current year is 2024 so should be empty I expected.

 ![Current sessions](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/9/7975eca27f36b39bb69620a8c4354b5ef99dae66.png)  
 ![Current Year](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/8/7842e204d220c7d279cc0dd2d3f4bd947ab09ea9.png)

Sorry, my bad. Just miscounted myself.  
This seems to work correctly this way

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [June 5, 2024, 7:52am UTC](https://community.glideapps.com/t/count-filter-based-on-current-date-year/73713/7 "2024-06-05T07:52:13Z")

</div>

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