Skip to Content
Learning Google BigQuery
book

Learning Google BigQuery

by Thirukkumaran Haridass, Eric Brown
December 2017
Beginner to intermediate
264 pages
5h 38m
English
Packt Publishing
Content preview from Learning Google BigQuery

Functions for transformation

Many of the functions discussed so far in this chapter can be used for the sanitation/transformation phase of data warehousing. Let's look at some of these functions with the specific task of sanitization/transformation:

  1. Decoding of encoded values. The CASE function can be used to create columns based on conditions of other columns:
 CASE   WHEN region = "W" THEN "West" WHEN region = "E" THEN "East"   END AS region
  1. Calculation of values. Any of the arithmetic functions can be used in this case:
 SUM(revenue) / COUNT(orders) AS average_order_value
  1. Splitting delimited string values into individual columns. The REGEX_EXTRACT() function can be used to extract individual parts of a string. Here is a how the function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google BigQuery: The Definitive Guide

Google BigQuery: The Definitive Guide

Valliappa Lakshmanan, Jordan Tigani
Google BigQuery Analytics

Google BigQuery Analytics

Siddartha Naidu, Jordan Tigani

Publisher Resources

ISBN: 9781787288591Supplemental Content