Book Image

Metabase Up and Running

By : Tim Abraham
Book Image

Metabase Up and Running

By: Tim Abraham

Overview of this book

Metabase is an open source business intelligence tool that helps you use data to answer questions about your business. This book will give you a detailed introduction to using Metabase in your organization to get the most value from your data. You’ll start by installing and setting up Metabase on your local computer. You’ll then progress to handling the administration aspect of Metabase by learning how to configure and deploy Metabase, manage accounts, and execute administrative tasks such as adding users and creating permissions and metadata. Complete with examples and detailed instructions, this book shows you how to create different visualizations, charts, and dashboards to gain insights from your data. As you advance, you’ll learn how to share the results with peers in your organization and cover production-related aspects such as embedding Metabase and auditing performance. Throughout the book, you’ll explore the entire data analytics process—from connecting your data sources, visualizing data, and creating dashboards through to daily reporting. By the end of this book, you’ll be ready to implement Metabase as an integral tool in your organization.
Table of Contents (15 chapters)
1
Section 1: Installing and Deploying Metabase
4
Section 2: Setting Up Your Instance and Asking Questions of Your Data
12
Section 3: Advanced Functionality and Paid Features

Creating saved SQL snippets

It may feel like a lot of the SQL we've written has been copied, pasted, and reused over and over again from other queries. This is common in SQL, common in programming in general, and considered an anti-pattern. In fact, there's a principle in computing called the DRY principle, which stands for Don't Repeat Yourself (https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). The principle is about how you should not rewrite the same line or lines of code again and again, as it is time-consuming and introduces more risk of bugs from typos.

Metabase has taken this principle to heart and has a feature called Saved SQL Snippets. A SQL snippet is a block of SQL that you can call upon in a single variable whenever you want to reuse it.

Throughout this chapter and book, we've been working with some iteration of the same query that takes the Orders table and flattens it out, such that every row becomes an item ordered, rather than an entire...