Загрузка страницы

Dynamic Dates in Custom Queries (Data Studio + BigQuery)

Dynamic dates from Data Studio in BiqQuery SQL.

I’m going to show you how to get dates from DataStudio’s date picker into your BiqQuery custom queries so you never have to manually change a date again.

First of all you need a date picker element in your report, and a widget which uses BiqQuery as a data source. In my example I’ve got a single metric displaying sessions, which currently doesn’t update when I change the date picker.

To make this happen, open the data source and edit your custom query.

This sample query calculates sessions. I’m using the between command to select only the GA export tables who suffix is between my start and end date, and therefore only counting sessions between those dates.

Replace the hardcoded dates with the @DS_START_DATE and @DS_END_DATE parameters. These are automatically populated whenever the date picker is changed.

Note that the parameters values are strings. If your query requires a date object or a string format other than year, month, day, you’ll have to use a combination of the PARSE_DATE and FORMAT_DATE function to convert them.

Save your query, and return to the dashboard. And that’s it! When you change your date picker, you’re query will re-run using the dates selected.

Видео Dynamic Dates in Custom Queries (Data Studio + BigQuery) канала Metric Mogul
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
5 сентября 2019 г. 17:58:11
00:02:30
Яндекс.Метрика