I've been tracking a bunch of dates (with format string) under the dimension 'Product' in Google Analytics.
In Data Studio, I then have a simple Line Chart with all these dates (x) and their respective List Views. Like this:
Is there a way to aggregate these days by month and year?
Like this:
2020-08
2020-09
2020-10
and so on...
Thanks in advance for your help.
Summary
The below creates a Date field and then uses the Date field in a Time Series chart with Date Granularity.
1) Product_Date
Creating the TODATE Data Source-level Calculated Field below to extract a Google Data Studio recognised Date field (where Product represents the current Date field):
TODATE(Product, "%Y-%m-%d", "%Y%m%d")
GIF to visualise the process:
2) Date Granularity
Chart Type: Time Series
Date Range Dimension: Product_Date
Dimension: Product_Date; set the Granularity as required (Year, Year Month, etc)
Drill-down (Optional): Select and set multiple Date Granularity as well as a default Drill-down.
Google Data Studio Report and a GIF to elaborate to the above:
Related
I want to know if it is possible to have 2 date range controls on my page. Each date range control would be connected to a different date (Purchase date / Consumption date) of our products).
Here is a simplified editable copy of the data studio report.
The Google Sheet source looks like:
ID
Purchase date
Consumption date
Product
Price
ABCD12
21/03/2022
09/11/2022
A
£50
EFGH34
22/03/2022
22/11/2022
B
£80
IJKL56
23/04/2022
15/11/2022
A
£50
MNOP78
24/03/2022
06/12/2022
A
£50
The output I'm looking for is to be able to filter data so that I can answer the question "how many products were purchased in March 2022 that have a consumption date in November 2022". The expected output is as follows:
ID
Purchase date
Consumption date
Product
Price
ABCD12
21/03/2022
09/11/2022
A
£50
EFGH34
22/03/2022
22/11/2022
B
£80
Supermetrics has a Date Picker that essentially does what I need it to do. But it has 2 downsides 1) it is bulky and does not work well with many years of data and 2) It does not allow breaking down to more than a monthly level.
Is there another way to make this happen with parameters?
Through this post I've gotten as far as getting a 'switch' for my graphs and tables between the two date datapoints, but that is not the solution I'm looking for.
actually you did find already a good solution by the 3rd party Add-one "Date Picker" from Supermetrics. An alternative route is to include two tables which only have the consumption date as a column. The user can then select these and do a cross filtering of the main table.
In the first table, the dimension has to be changed to "Year Month":
An alternative community visualisation to the Date Picker (based on the limitations cited in the question) would be the Range Slider.
Two Range Sliders could be used (one for each date field), however, the below will use one Date range control and one Range Slider to demonstrate that they can work together (as well as maintaining the original setup in the question):
1) Purchase date
1.1) Date range control
1.2) Table
Date Range Dimension: Purchase date
Dimension 1: ID
Dimension 2: Purchase date
Dimension 3: Consumption date
Dimension 4: Product
Metric: Price
2) Consumption date
2.1) Range Slider
Column to filter on: Consumption date
(Chart Interactions) Cross Filtering: ☑
Publicly editable Google Data Studio report (embedded Google Sheets data source) and a GIF to elaborate:
I have a table with column "date" in YYYY-MM-DD format HH:MM:SS:MMM (2015-01-27 11:22:03:742). I'm trying to make a time series with the dimension of month/year grouping, to display the total number of records by period.
Settings:
period dimension: date (type: date and time)
period: date (type: year and month)
metric: record count
My time graph doesn't display anything. Can someone help me identify what's going on?
formatDate is the column created with the expression:
PARSE_DATETIME("%Y-%m-%d %H:%M:%S",REGEXP_EXTRACT( create_date,"(.*):[0-9]*"))
Using the date in its standard format, as mentioned at the beginning of the question, the same happens.
When entering dates (original and formatted), both appear with null values.
The milliseconds have to be separated by a . not a :. An option is to import your date a as string/text and add a calculated field, which parse the string in Data Studio:
PARSE_DATETIME("%Y-%m-%d %H:%M:%S",REGEXP_EXTRACT( data_field,"(.*):[0-9]*"))
If the dates are several years in the past, please adjust the Default date range in your graph:
I leave the solution to my problem to the community.
The problem is in the date format. Failed to get Google Data Studio to receive a date with milliseconds. By removing the milliseconds it was possible to work with the dates normally, managing to apply the available functions.
Note: It may be a knowledge limitation, but none of the date formatting functions work if the datetime field contains milliseconds (FORMAT_DATETIME, PARSE_DATETIME,...)
I have a simple Data Studio table consisting of two columns. The first column is the week (ISO Year Week) and the second column is the total registrations we've received for that week.
However, my Week column repeats 7 times (7 Rows) for each week as it's counting by day within that week. See below:
Is there any way to get this to group by the listed week? Below are my settings:
Dimension = Conversion Date set as "ISO Year Week" for the type.
Metric = Equals the count of Conversion Date (Same Conversion Date field used for dimension)
Any help would be much appreciated.
There might be an issue with the date format of the source. Without knowing the source (e.g. Google Analytics or Sheets) it’s hard to tell.
Blended Data
I recently had this issue with blended data. The response of a similar question helped me to find a way.
Basically you have to add a new custom field to the data source with the formula WEEK(date_field_link). Data studio will recognise this as a date in compatibility mode, but for me it still works. Then you can use this new date field as a join key to blend the data while grouping it in weeks.
Normal Data
If this problem appears in a regular non-blended dataset you might want to check if Data Studio correctly catches the date as a date. This help article from Google might be worth checking out: https://support.google.com/datastudio/answer/6401549?hl=en#zippy=%2Cin-this-article
I made a similar case work using blended data.
Your column "Conversion Date" repeats the same week 7 times because it's just a display value. Every row has a date value (year, month and a day) but you're just showing the corresponding week. So, data-studio treats them as different data and doesn't group them.
To be able to group them by Week you need to create a new field with a value containing only the week and the year. So, you can use the formula
YEARWEEK(your_date)
The resulting Date will be groupable.
NB1: If your date isn't of the type Date, you can parse it from text to date using
the method:
PARSE_DATE("%Y-%m-%d", your_date_text)
NB2: If the created field has the type number and doesn't show the possibility to change type to Date, you can do this trick: (it's weird but it works):
First type as a formula for the created field and apply:
MONTH(your_date)
This will unlock the compatibility Date types. You can choose from them the ISO Year Week type.
and then change the formula from MONTH(your_date) to YEARWEEK(your_date) [your formula] as I explained above. The chosen date type won't go away even if it wasn't available the first time.
I have a list of objects. In my case, the object is a contract (agreement). The contract has two dates: the beginning and the end of the contract. Both dates are different columns.
I want to make it possible to filter all contracts by start and end date. for example, all contracts where the contract start data is 01.03.2020 - 31.03.2020 and end date is 01.11.2020 - 30.11.2020.
If I use the date range control, then it looks only the date range demension, which can be only one field (for example, only the beginning of the contract). But i need a solution where i can filter by one date or/and another date.
please help me how I could solve this problem.
Data structure:
Table settings:
One way that it can be achieved is by creating two Calculated Fields and adding them to two Advanced Filter Controls, where the values will be filtered in the YYYYMMDD format e.g. 27 Nov 2020 would be 20201127 (adapt the format as required by changing the inputs in the FORMAT_DATETIME function):
1) Start Date
1.1) Calculated Field
CAST(FORMAT_DATETIME("%Y%m%d", start_date) AS NUMBER )
1.2) Control
Type: Advanced Filter
Control Field: Start Date
Search Type: >=
2) End Date
2.1) Calculated Field
CAST(FORMAT_DATETIME("%Y%m%d", end_date) AS NUMBER )
2.2) Control
Type: Advanced Filter
Control Field: End Date
Search Type: <=
Editable Google Data Studio Report and a GIF to elaborate:
I am using BigQuery and Google Data Studio to build a table that shows customers total orders from their first purchase to the max date selected on the date range filter.
This is the sample dataset I have
This is the output I want
Not sure if Data Studio supports this. Is it an option to always use some old date like 01/01/1970 (set it as default) as the first date on the date range? That way you can just add Customer Id and First Order Date as Dimensions and count(Order Date) as Metric.