Issue working with time fields from BigQuery inside Dimension in LookML

I have a TIME field inside my source table in BigQuery that have the time (hh : mm :ss) of my transactions:

83a1c22c-b681-4987-85a8-23f8fec4f394.png
9d42c039-1655-4168-a949-5216c031d843.png

When created the view in LookML based on this table, automatically looker creates a Dimension like this:

  dimension: ID_HORA {
    type: date_time
    sql: ${TABLE}.ID_HORA ;;
    }
    

But when trying to use this dimension from the explore to build a New Tile I got this error in the underlying SQL query:

a45e0eda-56c1-4448-96f1-e636346a827f.png

 Like Looker is using FORMAT_TIMESTAMP function on this dimension and getting syntax error for arguments types: TIME.

Is any workaround or a solution to avoid this SQL error on my underlying query to BigQuery? I’m kind of new at LookML and Looker in general.

Thanks community. 

Solved Solved
1 3 174
1 ACCEPTED SOLUTION

 Hi Juan, 

Try with type “string” and in sql: case(id_hora as time).

Good luck

7aa0721b-386e-42b3-8c3a-d864eb0198d4.png
 

View solution in original post

3 REPLIES 3

 Hi Juan, 

Try with type “string” and in sql: case(id_hora as time).

Good luck

7aa0721b-386e-42b3-8c3a-d864eb0198d4.png
 

Thanks @Andrea_Calfuman this works fine!!

Roderick
Community Manager
Community Manager

Nice, @Andrea_Calfuman thanks for helping out in the community! 

Top Labels in this Space
Top Solution Authors