Do anyone know how to convert timestamp data into minutes and seconds in Data Studio?
On the screenshot below you can see the possible data types we have in Data Studio, which do not have any seconds and minutes involved.
You can use the TODATE or MINUTE and SECOND function into a calculated field to extract minutes and second from a date. However don't expect to display minutes and second datapoint on a line chart in Data Studio, timeserie charts only support hour-level data at a minimum.
Sign into Data Studio. Edit your data source. Locate the compatibility mode date field you want to convert. To the right, click the Type menu, then select Date or Date & Time.
There are two workarounds I can think of. 1) adding a new column to round the data (e.g. 163,904 to 164K) if you don't need the exact number. 2) Changing style to Horizontal Bar chart, then you can see the detailed value and they won't be overlapped.
Data Studio provides a number of powerful functions that can be used inside of calculated field formulas. See the list of functions.
In your case for getting minutes:
MINUTE(create_time, 'MILLIS')
This function returns the minutes in create_time
in UTC timezone.
For getting seconds:
SECOND(create_time, 'MILLIS')
This function returns the seconds in create_time
in UTC timezone.
And for getting minutes you could use the TODATE function too.
TODATE(create_time, 'MILLIS', '%M')
The TODATE function formats a datetime field according to the specified format.
More information on each function, including examples, is available in the formula editor. This help will appear as you begin to type your formula.
Do not forget to click on two links above for more explanation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With