Jaime Barroso
Jaime Barroso

Reputation: 21

BigQuery timestamp field in Data Studio error

I have data in a BigQuery instance with a some date fields in epoch/timestamp format. I'm trying to convert to a YYYYMMDD format or similar in order to create a report in Data Studio. I have tried the following solutions so far:

Am I doing something wrong? Why do I always get errors?

Thanks!

Upvotes: 2

Views: 4261

Answers (2)

datawrangler
datawrangler

Reputation: 19

The function for TODATE() is actually CURRENT_DATE(). Change timestamp to DATE using EXTRACT(DATE from variableName) make sure not use Legacy SQL ! The issue stayed, but changing the name of the variable from actual_delivery_date to ADelDate made it work. So I presume there's a bug and short(er) names may help to avoid it

Upvotes: 1

Xiaoxia Lin
Xiaoxia Lin

Reputation: 746

As commented by Elliott Brossard, the solution would be instead of using Data Studio for the conversion,use PARSE_DATE or PARSE_TIMESTAMP in BigQuery and convert it there instead.

Upvotes: 0

Related Questions