Google Looker – the basics

Google Looker Analytics Logo

First part gives a macro overview on Google Looker, so it’s time to start digging deeper.

Is Looker free?

No, Looker is not free. Looker Studio is free, but that is a different product. I really wish they could change names, remove one of those products or I don’t know…. so much confusion, even harder to find relevant stuff online.

Be mindful there here our focus is Looker. I will probably never talk about Looker Studio, so if you read Looker here, it is Looker, not Looker Studio. Every time I talk about Looker Studio I will call it Studio or Looker Studio.

Know more about Looker here: https://cloud.google.com/looker/docs

What is the difference between Looker and Looker Studio?

I don’t really know how to say this, but they might be similar… As far as I understand, Looker Studio is like a free, capped version of Looker, but I might be wrong, check image below, from Google itself.

They behave different, the way you ingest data and etc. In Looker you have LookML which I think you don’t get on Looker Studio, so…. Actually, you can even use Looker as data source for Looker Studio.

here’s what Google point out between Looker and Looker Studio

How do I access Looker?

To access Looker you need to go here https://cloud.google.com/resources/looker-free-trial and ask for your free trial.

Other option is to use Google Cloud Skill Boost labs, here: https://www.cloudskillsboost.google/focuses/21214?parent=catalog. Just start the lab and start messing around. You can start this lab some many times per day (10 I think). You don’t actually need to fulfill the lab requested, it is just a “hack” to give you access on a Looker platform in case your job doesn’t provide you one.

How do I get started creating visuals and insights with Looker?

Ok, so you are now inside Looker and want to work with it. You want to get your dataset and start creating visuals and etc, but how?

Let’s take for instance the lab I provided the link before. I’m inside it, but now what?

Looker home, landing page

If what you want is to create visuals, go to Explore > then choose a model and a dataset inside that model. In looker this dataset inside a model is called Explore.

Here I am selecting the Fruit Basket explore.

Looker explore

This is what I get:

insider Looker explore Fruit Basket
Note: if you need more definition on images, right click and open original

What we have here? Pretty different from what I am used to with Power BI, I must confess.

The deal here is to use the dimensions and measures in the left pane to create a data result, a table. Let’s take Color dimension and Average Price measure and see the result.

Boring, I got nothing… I mean, we got two columns, like table headers, that are now on our data results pane.

Looker result pane

In order to see the data we need to RUN this. So, let me click on RUN.

Now I have COLOR and AVERAGE PRICE data.

Looker result pane after hitting Run button

What else I can do here? You can create visualizations and add filters and do some other stuff with those measures and dimensions, like pivoting data, creating calculated custom fields, add filtering, and perhaps some other stuff I am not remembering now, but once you get the hang of how this explore works, it became intuitive.

Here’s a view on some other options expanded in our Explore window.

Looker Explore panes open

Ok, great, but what if I want to add more data? More tables, more measures, more dimensions, how do I create relationships between that data?

How to add more data to my Explore?

So far we have the Fruit Basket explore, but what if I want to add more measures and dimensions to it?

You can do that by creating CUSTOM FIELDS, here the documentation on this custom fields: https://cloud.google.com/looker/docs/custom-fields, but basically, custom fields are like expressions, formulas on excel, or your DAX measures.

custom fields options

Let’s say I want to know the percentage of the total that each Average Price represents.

First, let me add the TOTAL row to this result and RUN this again, so we can have a better understanding what is going on.

totals enabled

So, if RED is 0.72 from a 0.55 total, then we can do this simple math, where RED minus TOTAL divided by TOTAL equals RED representation of it’s percentage of the total. Therefore; ( 0.72 – 0.55 ) / 0.55 equals approximately 30%.

We can do this by adding a Pie Chart and checking the distributed percentage:

Looker pie chart

We also can add a calculation, by clicking in ADD CALCULATION (near the TOTALS checkbox).

custom fields for table calculation
table calculation field New Calculation2 added

Of course, this was created using Looker UI, which is great, but you could also have written the thing down. More on table calculations here https://cloud.google.com/looker/docs/table-calculations

Here’s how to write this very calculation, as the documentation tell us:

Lexp = field_1/sum(field_1)
manually entering a formula expression on Looker
both results matches

So far we talked about adding more data to enhance your analysis by adding custom fields, but, what if we want to add even more data, like adding for the database, the source itself, how?

How to add even more data to your Explore

If custom fields is not enough for you, then your next option is tweaking around your views and models.

subtle link gets you to the LookML source

You can access your models and views by clicking on Go to LookML inside your Explore, or you can go back to Looker home and go Develop.

or use Develop option from the menu

Inside Develop menu you have Projects, check it there. Fruits_basket will be within qwiklabs-flights.

Fruit Basket is a pretty simple example and therefore doesn’t have its own project structure, but it will serve us for now.

So this is the source of our Fruit Basket Explore:

fruit basket model, and explore, and view, they are all bundled together here

As the image shows we have a “explore: fruit_basket {}” that defines our explore name, after that we have the view and after that dimensions. The image doesn’t show, but we have measures at the end of this file, here:

fruit basket measures

There is also another type of navigation available within the Develop area, the Object Browser. So far we were using the File Browser, which I think is a good place to be when you are starting your model, but if what you want is to modify your already created model, perhaps it is worth checking the Object Browser, like this:

object browser

Let’s say I wanna do something in my model, like, create a new dimension or measure… For that, first, activate DEVELOPMENT MODE.

activate development mode

If you feel like creating a new dimension, read this documentation: https://cloud.google.com/looker/docs/reference/param-dimension-filter-parameter-types, but if you are looking for measures, check this https://cloud.google.com/looker/docs/reference/param-measure-types.

Here I create a new dimension called “price_per_pound_time_weight” (typo: should’ve been “times”, not time).

new dimension I created

This dimension takes the value of price_per_pound and multiplies per weight. Notice that the variables I’m using here are the ones from the the other dimensions, and not data directly from the table source. This is the result:

price per pound time weight as shown in the Explore

Wrapping up

Let me stop right here, we have covered some very interesting topics and this will give you enough information to cover the basics. Make sure to read the documentation links I left throughout the reading.

That’s all I have for now, and here are some topics idea for part 2, so stay tuned! =)

  • How do I load data into Looker from database / csv / Google Sheets ?
  • What is a LookML project?
  • What are views in Looker?
  • What are models in Looker?

Reference

https://youtu.be/PuLUcmAzyO8 – Looker – Database to Dashboard Technical Demo

https://youtu.be/fbgva493gb8 – Technical deep dive on Looker: The enterprise BI solution for Google Cloud

Published by Pedro Carvalho

Apaixonado por análise de dados e Power BI

Deixe uma resposta

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: