# Template for date grouping

**URL:** https://community.fibery.io/t/template-for-date-grouping/2678
**Category:** News & Announcements
**Created:** [April 4, 2022, 3:01pm UTC](https://community.fibery.io/t/template-for-date-grouping/2678 "2022-04-04T15:01:47Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![rothnic](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/rothnic/32/1850_2.png) [@rothnic](https://community.fibery.io/u/rothnic)
#### Post date: [April 4, 2022, 10:32pm UTC](https://community.fibery.io/t/template-for-date-grouping/2678/5 "2022-04-04T22:32:36Z")

</div>

> [@Chr1sG](#):
>
> You can create a relation to the Year-quarter database, and define an automation so that whenever the date field is updated (and not empty) the Year-quarter field is updated, based on finding the Year-quarter for which the date is within its range (e.g. Date \>= Year-quarter.First date AND Date \<= Year-quarter.Last date).  
> You could then also have an automation so that when the Year-quarter is updated, the date field is updated (to the First date or Last date as is your preference).

Yep, that is exactly where I was heading, but haven’t had a chance to go back into it.

I haven’t had a chance to go through what you put together, but [this template](https://shared.fibery.io/t/ce8de110-8e30-405d-8c48-04d99a74a650-date-testing) takes where I was heading and supports automatically generating dates without having to upload them.

There is still a lot to do, like handle weeks, but when working with this I found it important to take a specific approach to how the data was being related. This takes a top down approach where each date type knows how to create missing related date entities.

I do wish there was better support for applying a consistent approach to entities you want the dates related to, so I ended up framing out an area associated with the Dates (Date Settings), which would provide a place to configure how the template behaves and potentially having it apply stuff to other databases that you configure there.

---

_[View the full topic](https://community.fibery.io/t/template-for-date-grouping/2678)._
