Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get minutes and seconds in Google Data Studio?

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.

minutes and seconds in Google Data Studio

like image 666
Indrajeet Gour Avatar asked May 11 '18 05:05

Indrajeet Gour


People also ask

How do you show duration in a Data Studio?

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.

How do you insert date and time in Data Studio?

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.

How do I change the number format in Google Data Studio?

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.


1 Answers

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.

like image 176
Bharata Avatar answered Sep 20 '22 06:09

Bharata