Skip to content

Tag: google-bigquery

google bigQuery subqueries to joins

I have the following table. basically simplified version of my table. I need to aggregate few columns, I will explain what I am trying to do and also what I have written till now. tableName variations can be like pizza toppings, each variation has an amount, say veggie toppings cost 10 cent and meat toppings …

Identifying products that a customer owns

I want to check whether my customer owns an iPhone, iPad, or Macbook. I am not looking for how many iPhone or iPad or Macbook one customer has, I just want to identify if they own any of them, or if they own any two, or if they own all three. I am thinking of using the CASE WHEN function

Calculate a running total with a condition in BigQuery

Sorry bad topic… I need to calculate a running total but need to reset the total on a condition (when expected reached = 0). I have this table: Expected result with running total – the condition is that while “Expected Reached” <> 0 running total should be calculated. If “Expected Reached” = 0 the…

Spliting Name in Google BigQuery

Split FullName into firstName and lastName. I want to split the full name based on “,” into firstName and LastName. anything before “,” should be selected as firstName and anything “,” should be the lastName. I used split(fullName) function and used offset to grab the first…