Skip to content
Advertisement

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 Login 2021-02-20 00:01:00 UTC ccc Login 2021-02-20 00:02:00 UTC

WHERE clause expression references [casted timestamp to date column] which is neither grouped nor aggregated at

This query should sum up all the records by Error_Type (nested) and by Application(nested) in the Failed_Record_Count column. Total_Record_Count column should sum up all the records from the table(excluding unnested tables). However, an error referencing to a.timestamp in the subquery is said to be neither grouped nor aggregated. I noticed that when removing the “DATE” function from the select list,

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_TIME_PART) at [10:3] My sample data and query are below. Sample data Attributed_time install_time user_id 2021-02-20 18:42:31 2021-02-20 18:55:06 UTC A 2021-02-20 11:10:53 2021-02-20

Advertisement