14.3. Advanced Date Range Selector
In this lesson, we're going to explore how to work with a dynamic date range and display different aggregated data, such as a rolling dynamic date range for metrics within Looker Studio.
Creating a Dynamic Date Range
To create a dynamic date range, follow these steps:
- Add a new data source to your report or use an existing one.
- Select the metric you want to display (e.g., total events within a specific range).
- Add a date range control to your report, which allows you to set the date range for your metric.
- Configure the date range control with advanced options.
Here's how to configure the advanced options for a dynamic date range:
- Select the Advanced Date Range option.
- Set the start and end dates to dynamic rules, for instance:
- For the end date, set it to today minus 1 day (yesterday).
- For the start date, set it to today minus 4 days (four days ago).
When you apply these rules, the date range control will always display the most recent data, depending on the specified guidelines.
Displaying Multiple Date Ranges in a Table
If you want to display multiple date ranges on the same table, such as yesterday, three days ago, and seven days ago, you'll need to create three separate data sources and apply custom date ranges for each of them. Once each data source reflects the desired date range, blend them together and display them in a single table.
However, for a more comprehensive view, it's better to use a visualization that shows data points between the date ranges, such as a line chart that displays a weekly trend. You can select a custom date range, configure days with the actual dates, and display an overview of the entire week, which provides additional insights into the data.
Keep in mind that, when possible, opt for a visualization that provides a more comprehensive view of the data instead of isolating specific date ranges in a single table.