Skip to content

Google BigQuery Dimensions SQL Multiple Grids

how would you select multiple grids in the example below instead of just one under “WHERE”: What needs to be changed: It currently only runs for 1 organisation (GRID), I would like it to run for 11 organisations. The org is identified with an ID called a “GRID”, it looks like this: “grid.517…

Case statement in multiple conditions?

I want to check the column mr.name, if mr.name is null then i have to replace mr.name as mr.ticket_no. How? Can use if else or case? When i use like this it will throw an error if mr.name = null means i have to replace mr.name = mr.ticket_no. I want to check the column mr.name, if mr.name is null then

Using NEW and COPY in a Postgres Trigger

I’m trying to copy the last inserted row from a table into a csv file using a trigger. I’ve tried this in various incarnations, with or without EXECUTE but I’m still getting the error. Just cannot get it to access the NEW data. Where am I going wrong ? Answer Adrian’s answer inspired m…

Combining Aggregate Function with resampling in Impala

I have Table in Hadoop in which I have data for different sensor units with a sampling time ts of 1 mSec. I can resample the data for a single unit with a combination of different aggregate functions using the following query in Impala (Let’s say I want to resample the data for each 5 minute using LAST_…

determine duplication rate per group

EDIT: Previous sample data included the duplicate visits column I need that calculated in the solution. I am trying to determine the total_visits = total visits per website per sub_group duplicate_visits = visits-1 duplication_rate = duplicate_visits/ total_visits distinct_users_subgroup = distinct users per …