Skip to content
Advertisement

Tag: google-bigquery

Bigquery Full Join ON multiple conditions

I want to perform a Full Outer join on two tables with multiple conditions to result all the matching records along with unmatched records from both tables. Tbl1 is a bigger table with 21 M records and Tbl2 has 5k rows, like the example query below. But the outer join cannot be performed with OR conditions because of the error

How to run a query for current date for date partitioned tables?

I have a table that is partitioned by date so something like ‘tablename_20191205’. Is there a way for me to run the query everyday without having to modify the date? Also how would I do this if I am using two tables. So instead of typing, Select * From ‘tablename_20191205’as table1 and ‘tablename2_20191205’ as table2 and modifying the date everyday.

Extract user journey data between two pages in BigQuery Google Analytics data

How to extract users’ journey data between two specific pages in Google Analytics BigQuery Export data? Example: Website has 100 pages: hits.page.pagePath=/page_1 to hits.page.pagePath=/page_100. Goal is to extract user journey data from /page_13 to /page_22, including all in-between pages. The challenge is that the journey is not sequential, like /page_13 -> /page14 -> … -> /page_22. But could be /page13

SQL: Filling in Missing Records with Conditional

I need to count the number of products that existed in inventory by date. In the database however, a product is only recorded when it was viewed by a consumer. For example consider this basic table structure: Using the following query, I attempt to determine the amount of products in inventory on a given date. This is the output My

Equivalent of string contains in google bigquery

I have a table like as shown below I would like to create two new binary columns indicating whether the subject had steroids and aspirin. I am looking to implement this in Postgresql and google bigquery I tried the below but it doesn’t work I expect my output to be like as shown below Answer Below is for BigQuery Standard

Advertisement