# Changing date field granularity on dashboards

**URL:** <https://community.amazonquick.com/t/changing-date-field-granularity-on-dashboards/5869>\
**Category:** Q&A\
**Tags:** charts, quick-sight\
**Created:** [September 7, 2022, 3:47pm UTC](https://community.amazonquick.com/t/changing-date-field-granularity-on-dashboards/5869 "2022-09-07T15:47:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nadav\_Kavalerchik](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/nadav_kavalerchik/32/1096_2.png) [@Nadav\_Kavalerchik](https://community.amazonquick.com/u/Nadav_Kavalerchik)\
**Post date:** [September 7, 2022, 3:47pm UTC](https://community.amazonquick.com/t/changing-date-field-granularity-on-dashboards/5869/1 "2022-09-07T15:47:03Z")

</div>

It seems that after I publish an Analysis to a Dashboard, The users that view the Dashboard are unable to changing date field granularity.

Am I missing some configuration setting? or is this intentional? or bug?

---

<div class="post-metadata">

**Author:** ![Max](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/max/32/2288_2.png) [@Max](https://community.amazonquick.com/u/Max)\
**Post date:** [September 7, 2022, 8:30pm UTC](https://community.amazonquick.com/t/changing-date-field-granularity-on-dashboards/5869/2 "2022-09-07T20:30:08Z")

</div>

Hi Nadav,

This is intentional. In an analysis you are creating what they end user of a dashboard is going to see. When you select the date field granularity and publish it out, that is the granularity the end user will see it as.

This is true for aggregations as well such as sums and averages. Once you publish the dashboard out, it will stay at that aggregation.

You can allow users to change the date field granularity with the use of parameters but that is not natively built in.

---

<div class="post-metadata">

**Author:** ![Nadav\_Kavalerchik](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/nadav_kavalerchik/32/1096_2.png) [@Nadav\_Kavalerchik](https://community.amazonquick.com/u/Nadav_Kavalerchik)\
**Post date:** [September 7, 2022, 8:51pm UTC](https://community.amazonquick.com/t/changing-date-field-granularity-on-dashboards/5869/3 "2022-09-07T20:51:37Z")

</div>

Thank you @Max , I will add parameters to solve this, as our users (academic scientists and researchers) would like to play around with the date field granularity.  
It would have been very helpful if it was an option I can opt in when publishing a dashboard. (like the filters)  
I will post it directly with AWS QS team as feature request.

---

<div class="post-metadata">

**Author:** ![tylerhillery](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/tylerhillery/32/4188_2.png) [@tylerhillery](https://community.amazonquick.com/u/tylerhillery)\
**Post date:** [November 14, 2022, 3:40pm UTC](https://community.amazonquick.com/t/changing-date-field-granularity-on-dashboards/5869/4 "2022-11-14T15:40:31Z")

</div>

Max do you have a solution as to how to do this with the use of parameters? I want to be able to change the date field aggregate to monthly, quarterly or yearly. Similar to how it’s done here [https://democentral.learnquicksight.online/#Dashboard-TipsAndTricks-Calculation-Switch-Date-Aggregation](https://democentral.learnquicksight.online/#Dashboard-TipsAndTricks-Calculation-Switch-Date-Aggregation)

---

<div class="post-metadata">

**Author:** ![Max](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/max/32/2288_2.png) [@Max](https://community.amazonquick.com/u/Max)\
**Post date:** [November 14, 2022, 3:51pm UTC](https://community.amazonquick.com/t/changing-date-field-granularity-on-dashboards/5869/5 "2022-11-14T15:51:20Z")

</div>

First you would make a parameter, let’s call it granularity.

Then you make a calculated field that will look for the parameter and truncate the date based on what is given by the parameter.

calculated\_date\_field = ifelse(${granularity}=‘Quarter’,truncDate(‘Q’,{date\_field}) ,${granularity}=‘Month’,truncDate(‘MM’,{date\_field})  
,${granularity}=‘Week’,truncDate(‘WK’,{date\_field}),  
truncDate(‘DD’,{date\_field}))

You would then make a control of your parameter with the hard coded values of Quarter, Month, Week, Day in it.

Finally, you would use the calculated\_date\_field as your date field.

---

<div class="post-metadata">

**Author:** ![smithgce](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@smithgce](https://community.amazonquick.com/u/smithgce)\
**Post date:** [January 19, 2024, 5:40pm UTC](https://community.amazonquick.com/t/changing-date-field-granularity-on-dashboards/5869/6 "2024-01-19T17:40:19Z")

</div>

This is great, but as an FYI to anyone that may want to use this approach, please be careful when copy and pasting the above due to the smart quotes. It took me 45 minutes to figure out why my syntax was incorrect.

---

<div class="post-metadata">

**Author:** ![Parvathy](https://avatars.discourse-cdn.com/v4/letter/p/edb3f5/32.png) [@Parvathy](https://community.amazonquick.com/u/Parvathy)\
**Post date:** [February 26, 2024, 4:38am UTC](https://community.amazonquick.com/t/changing-date-field-granularity-on-dashboards/5869/7 "2024-02-26T04:38:51Z")

</div>

Hi Max , Thank you sharing the details. I am new to creating dashboard and I tried using the same approach but getting an syntax error using the calculated filed.
