I have a Looker dashboard with a date filter and some visualizations. One of the visualizations is a bar chart showing some measures for each date in the range. I would like to show an hourly breakdown if the user selects a single day on the date filter and if they select a range of dates to show a daily breakdown. The date column selected for the visualization is currently the date option from a dimension_group with the LookML defined like this:
dimension_group: insert_date {
type: time
timeframes: [hour,date,week,month,year,raw]
convert_tz: no
datatype: datetime
sql: ${TABLE}.insert_date ;;
}
The filter is currently selected as “Insert Date Date” and Control set to “Advanced”.
I’ve done a lot of reading about parameters and templated filters and cannot figure out how to do this. Any help would be appreciated!
Next, go into each of your visualizations on the dashboard and replace the instances of “insert_date” with “dynamic_insert_date”.
Finally, add the “date_granularity” parameter as a dashboard filter. Now, users can select “Hourly” or “Daily” to change the date granularity for all visualizations on the dashboard.
It would be nice for it to automatically change depending on the date filter selection, but at least this way the user can see the hourly breakdown even for multiple days if they would like.