De-Nesting Google Analytics Data in BigQuery

The proper way to flat tables

Martin Weitzmann
Towards Data Science
5 min readMar 26, 2024

--

Photo of Singapore by Mike Enerio on Unsplash

BigQuery is an analytics engine optimized to crunch pre-joined (or: nested) data. Sub-relations make sense in analytical scenarios because we don’t want to deal with joins over bigger datasets — just imagine daily year-over-year comparisons over the last 3 years, aggregating Terabytes of data — but with joins adding another layer of…

--

--