![](https://cdn.qwiklabs.com/assets/labs/start_lab-f45aca49782d4033c3ff688160387ac98c66941d.png)
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you restart it, you'll have to start from the beginning.
- On the top left of your screen, click Start lab to begin
Create a custom measure
/ 80
Use the table calculations
/ 20
Looker provides the ability for non-developer users to create and utilize ad hoc fields for richer data analysis. This is done by creating custom measures, custom dimensions, table calculations and using custom groupings to narrow down data to match specific conditions.
Using ad hoc fields gives non-developers the ability to create new fields, as opposed to regular fields, which require that you have development permissions and understand LookML allowing them to have more flexibility in finding data they are looking for independently.
In this lab, you will learn how to:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
When ready, click Start Lab.
The Lab Details pane appears with the temporary credentials that you must use for this lab.
If you need to pay for the lab, a pop-up opens for you to select your payment method.
Notice your lab credentials in the Lab details pane. You use them to sign in to the Looker instance for this lab.
Click Open Looker.
Enter the provided Username and Password in the Email and Password fields.
Username:
Password:
Click Log In.
After a successful login, you see the Looker instance for this lab.
In this section, you will create a custom measure based on an existing dimension.
First, on the bottom left of the Looker User Interface, click the toggle button to enter Development mode.
Click the Explore tab and then select E-Commerce Training > Order Items.
Expand the Inventory Items section.
Click More () next to the Cost dimension to review the custom fields you can add.
Select the Aggregate > Average custom field to create a measure that calculates the average of an order item’s cost.
The suggested functions vary based on the type of dimension you’ve chosen (such as number, text, and date). If you select count, a count distinct
is executed in the generated SQL. Your new field is automatically added to the query.
Expand the Custom Fields section to see your new field.
As with other fields, you can click a custom field’s name to add or remove it from a query. You can also hover over the field to reveal more options available for that field, including clicking its Filter by field icon to use it as a filter in a query.
If you want to define a format or a filter for your custom measure while creating it, start with the + Add button on the Custom Fields section.
Expand the Custom Fields section.
Click + Add and then select Custom Measure.
Set the Field to measure to Inventory Items > Cost
.
Set the Measure type to Average
.
Set the Name to Average of Cost
.
On the Field details tab set the following:
Format
: U.S. Dollars
Decimals
: 2
The Group custom field type lets you create ad hoc custom groups for dimensions and custom dimensions without needing to use logical functions in Looker expressions or needing to develop CASE WHEN logic in sql parameters or type: case fields.
This can be helpful when you want to assign fixed labels or category names to values that match specific conditions, for example, by grouping specific states or countries into regions or order costs into categories.
You should now see two Average of Cost custom fields in the Custom Fields section. Select just the bottom one to add it to the query.
Expand the Inventory Items section and select the Product Name dimension to add it to the query.
Expand the Users section and select the Filter by field icon for the Country dimension and set the drop down to is equal to
and the value to USA.
Next, click More () next to State under the Users section and select Group.
In the Group By State dialog, set the Add group name to Pacific Northwest
.
Click the is any value
input box and add Oregon, Idaho and Washington to the list independently.
Check the Group remaining values checkbox then click Save.
State Groups
custom field to add it to the Explore and click Run in the top right of the page.The result will be a view of the average cost of various product names grouped by Pacific Northwest
and Other
.
Now that you have a view of the average cost of various product names grouped by Pacific Northwest
and Other
, say you wanted to only view products with an average cost greater than $200 (USD).
To enhance the current view do the following:
Average of Cost
under Measures.Set the drop down to is greater than
and set its value to 200.
Re-run the query by clicking on the Run button in the top right of the page to view the results.
You will now see a filtered view with only the average of cost products greater than $200 (USD).
Click Check my progress to verify the objective.
Say you wanted to understand the count of orders for each item in the view from the last section. To filter the view further you could add the Order Count and use the Percentage of Column quick calculation to get an idea of how popular a product is by the State Groups custom field created earlier in this lab.
Under Order Items section, click Order Count to add it to the view.
In the data view, click Settings () on the Order Count column.
Click Calculations > % of column.
A new table calculation column with the percentage of Order Count should be populated into the Explore.
Click Check my progress to verify the objective.
In this lab you learned how to define and read core LookML terms and concepts. You then learned how to organize and understand the main LookML structures and hierarchy, created a view, added dimensions and measures to it, and joined the view to an existing Explore.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated July 25, 2022
Lab Last Tested April 20, 2022
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.