Changing date field granularity on dashboards

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?

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.

3 Likes

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.

1 Like

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

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.

1 Like

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.

1 Like

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.