13.11. Dynamic Date Range Granularity Selector - Looker Studio Tutorial/Data Studio Training Course

preview_player
Показать описание
The dynamic date range granularity selector allows you to change the granularity of a chart in Looker Studio without navigating to different pages or using multiple charts. This can be achieved using parameters, case functions, and controls in a creative way.

*Looker Studio Certification:*
When you're ready, take the final exam to test your knowledge and become a certified Looker Studio Expert →

🔔 Subscribe and turn on notifications so you don't miss the future lessons!

## Setting Up the Dimension

First, create a dimension using a case statement. The dimension should change based on the value of a parameter. For example, when the parameter's value is 1, the dimension should display dates in a day format, and when the parameter's value is 2, the dimension should display dates in a week format, and so on.

## Creating the Parameter

Create a parameter of type number with a range from 1 to 4 (or any other range based on your needs). This parameter will be used to determine the granularity of the chart.

## Creating the Click Effect

To create the click effect, follow these steps:

1. Add icons for each granularity level to your report (e.g., daily, weekly, monthly, and yearly).
2. Place a slider control in your report, setting the opacity to 0, making it completely transparent.
3. Adjust the slider control's position so that it overlays the icons, creating the appearance of clickable buttons.

When users click on the icons, they will actually be interacting with the transparent slider control. The slider control will change the value of the parameter, and the chart's granularity will update accordingly.

## Example

In the given example, a chart's granularity can be changed from daily to weekly, monthly, and yearly views without changing the URL or navigating to a different page. This is done by creatively using case statements, parameters, and controls in Looker Studio.

Remember that this technique is a clever workaround and may not be officially supported by Looker Studio. Nonetheless, it can be a useful way to create a dynamic and interactive report.

Рекомендации по теме
Комментарии
Автор

this genuinely just changed my life holy shit i love u thank you for your teachings

spryte
Автор

I feel this only works without any restriction on the date range no ? How would you do if we want to control both date rage (last month only for example) and this technique ?

fnxmovies
Автор

How can I create those date range toggle buttons on a table with blended data source? I couldn't create parameter on the blended data source.

eArminCom
Автор

Is it possible to build it to apply the filters to all the charts of the page?

SantragoPipian
Автор

Hello! This is not 100% related, but I want to filter out 3 dates from a chart in Looker. Is this possible? Thanks for your awesome videos :)

Elishea
Автор

Thank you for the video! Is it possible to do the same thing with a time-series graph? If yes -- how?

AlexAlex-jzix
Автор

hey i'm curious on how to sort the dates. mine wasn't sorting correctly though.. should be from Jan to Dec but its scrambling hmmm (PS: i did sort in ascending order)

luqman
Автор

CASE
  WHEN Date Granularity = 1 THEN CAST(TODATE(Date, "%Y-%m-%d") AS TEXT)
  WHEN Date Granularity = 1 THEN CAST(TODATE(Date, "%Y W%W") AS TEXT)
  WHEN Date Granularity = 1 THEN CAST(TODATE(Date, "%Y-%m") AS TEXT)
  WHEN Date Granularity = 1 THEN CAST(TODATE(Date, "%Y") AS TEXT)
END

ErsinErtan
Автор

i try it, but it fail. Your explanation is not clear for a beginner

kwonjiyong
Автор

I honestly do not understand the point of this video. I am trying to achieve the exact same result as what you explain in the video, but you don't explain how to achieve it.

LeeSandwith