Rud48
Rud48

Reputation: 1074

Create Data Studio Report Table with Date and Time Column from Unix Time in Big Query

I have IOT data with a Unix time. I need to show this to the second in a Data Studio table report. Cannot make this work. In the PubSub function I have:

    d = new Date();
d.setTime(res[0] * 1000); // 1000 is for JS time
console.log( d.toISOString());

and later set the field with:

timestamp:d.toISOString(),

Using BigQuery the table shows the field as:

2018-07-06 23:44:49 UTC

which is correct. The 'timestamp' field in Data Studio appears in the table as just:

July 6, 2018

I need to get more resolution, down to the second, for the table and eventually graphs. I've tried custom queries for the data source but cannot get Data Studio to show better resolution.

I tried creating a new field using TODATE(timestamp, 'RFC_3339', "%Y%m%d%H") but cannot that also just shows the July 7, 2018 format. Cannot get it to go to greater resolution.

Yes, I've tried all the other approaches suggested in other questions but none match what I am trying, or they don't succeed.

Upvotes: 0

Views: 1306

Answers (1)

Héctor Neri
Héctor Neri

Reputation: 1452

From what I can see on the DataStudio documentation, this product doesn't support seconds for their date output formats, it only supports up to the minute for output formats and for the 'mm' date type.

I suggest to vote on the related feature requests to support more specific time resolution. 1 2

Upvotes: 1

Related Questions