Skip to content

Tag: google-bigquery

calculation with undefined number of rows

I would like to add a calculation taking into account we could have one, two, three or a lot of more rows. We can get all the data using the relations but I am a bit stuck because the number of relation are undefined. For example, as a source: Source Table id amount debt relation rn 123 250 225 NULL

Calculate Time Between Logins by User in Bigquery

I am trying to calculate the time difference between 2 login events in BigQuery, by user. I want to understand how long it takes between logins for each user. I’ve tried with the following query: Sample Data user_id event timestamp aaa Login 2021-02-20 00:00:00 UTC bbb Login 2021-02-20 00:02:00 UTC aaa …

Calculating timestamp difference in seconds in BQ

I am trying to calculate the timestamp difference between install_time and attributed_time, in seconds. However, I keep receiving this error: No matching signature for function TIMESTAMP_DIFF for argument types: TIMESTAMP, STRING, DATE_TIME_PART. Supported signature: TIMESTAMP_DIFF(TIMESTAMP, TIMESTAMP, DATE_…