Count / Filter based on current date (year)

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

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

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.

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

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

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.

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.

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

1 Like

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