Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Business Intelligence with Looker Cookbook

You're reading from   Business Intelligence with Looker Cookbook Create BI solutions and data applications to explore and share insights in real time

Arrow left icon
Product type Paperback
Published in May 2024
Publisher Packt
ISBN-13 9781800560956
Length 256 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Khrystyna Grynko Khrystyna Grynko
Author Profile Icon Khrystyna Grynko
Khrystyna Grynko
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Chapter 1: Getting Started with Looker FREE CHAPTER 2. Chapter 2: Configuring Views and Models in a LookML Project 3. Chapter 3: Working with Data in Explores 4. Chapter 4: Customizing and Serving Dashboards 5. Chapter 5: Making Dashboards Interactive through Dynamic Elements 6. Chapter 6: Troubleshooting Looker 7. Chapter 7: Integrating Looker with Other Applications 8. Chapter 8: Organizing the Looker Environment 9. Chapter 9: Administering and Monitoring Looker 10. Chapter 10: Preparing to Develop Looker Applications 11. Index 12. Other Books You May Enjoy

Creating a LookML model and Explore

As seen in the previous recipe, a LookML project is a collection of files that define a semantic data model for a SQL database. It contains model files, view files, and other types of files. We explored views that represent your database/data warehouse tables. Now, to make these dimensions and measures in the views usable, we need to create Explores.

An Explore is a custom view of the data that is defined using a LookML model. It is the starting point for querying data in Looker. Explores in Looker empower self-service data analysis with secure access, enabling creation of reports, dashboards, and visualizations. Explores can be based on one or multiple tables.

Explores are created in the LookML model file. The LookML model files contain Explores based on one or multiple tables joined (Figure 1.31).

Figure 1.31 – LookML project organization (image from GC documentation)

Figure 1.31 – LookML project organization (image from GC documentation)

Model files can contain different additional parameters, which we will review later in this book.

Getting ready

When you created your LookML projects and chose Generate Model from Database Schema, your model file was created by default. Click on your test_project.model model file to open it in the code editor (Figure 1.32). In this model file created automatically, you see multiple elements: connection, include, datagroup, persist_with, and explore. We will understand the meaning of all of them later, but for now, let’s create our own model file and the Explore in it.

Make sure you’re in Development Mode.

Figure 1.32 – Model

Figure 1.32 – Model

How to do it...

The steps for this recipe are as follows:

  1. To the right of File Browser, click on the + symbol and choose Create Model (Figure 1.33). You will need to provide a name for your model; let’s call it devices_model.
Figure 1.33 – LookML file creation

Figure 1.33 – LookML file creation

  1. When the model file is created, it is usually created outside of the models section but you can always move it there (just drag and drop it). You will see that the model contains connection and include sample elements. connection specifies the database/data warehouse connection, and include specifies the files that can be used in this model. You can change these elements if needed, but for now, we’ll keep the default options. Other elements are commented with the # symbol, and serve to show you how to create your first Explores based on multiple views (Figure 1.34).
Figure 1.34 – Device model

Figure 1.34 – Device model

  1. Delete all the commented (gray) section and start typing explore: {}. Add the name of our only view, device_category_jan2021. It will look like this: explore: 'device_category_jan2021 {}'(Figure 1.35). It is something we’ve seen in the automatically created model. The include parameter that you see in the figure is a way to bring together different LookML files. It lets you access and use components from other files within your current file. You can use it in model, view, and explore files to include different types of files, such as view files, dashboard files, Explore files, and data test files.
Figure 1.35 – Explore

Figure 1.35 – Explore

  1. Click on Save Changes.
  2. Click on the arrow icon to the right of devices_model.model and make sure that Explore Device Category Jan2021 – devices_model was created (Figure 1.36).
Figure 1.36 – Model drop-down list

Figure 1.36 – Model drop-down list

  1. Click on Explore Device Category Jan2021 – devices_model and the Explore environment will open (Figure 1.37).
Figure 1.37 – Explore environment

Figure 1.37 – Explore environment

How it works...

Looker has three basic types of users: Developer (Admin), Standard (Creator), and Viewer. When we were in the LookML project, we acted as a Developer user.

In the Explore space that we just opened, we’ll act as Standard users or creators, those who can create visualizations (or Looks). Let’s explore Explores in the next sections.

See also

You have been reading a chapter from
Business Intelligence with Looker Cookbook
Published in: May 2024
Publisher: Packt
ISBN-13: 9781800560956
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image