Build a Look with sample data

Learn how to query and visualize data in Looker and to save your query results as a Look that you can share and reuse.

This quickstart guides you through building a Look on your Looker (Google Cloud core) instance. You'll use sample data from the prebuilt Intermediate EcommerceExplore to create the following table chart, and then you'll save the chart as a Look.

The table chart that you'll create will display weekly shipping trends, using conditional formatting (such as a red background) to highlight potential delays (in this case, weeks where more than 200 order items took over two days to be delivered). The following table is an example of the query results that you'll use to build your Look:

Created At Week 2024-07-29 2024-07-22 2024-07-15 2024-07-08 2024-07-01 2024-06-24 2024-06-17 2024-06-10
Shipped to Delivered Days
# of Order Items # of Order Items # of Order Items # of Order Items # of Order Items # of Order Items # of Order Items # of Order Items
4
451 242 210 199 163 152 189 177
3
422 260 213 177 213 144 171 165

Before you begin

To follow along with this quickstart, you'll need access to a Looker (Google Cloud core) instance that includes the sample LookML project . The sample project includes the prebuilt Intermediate EcommerceExplore that is used in this quickstart.

You'll also need to have a the following Looker permissions on your Looker (Google Cloud core) instance (or a Looker role that includes these permissions):

  • access_data : Access the sample data in the Intermediate EcommerceExplore.
  • explore : Access the Explore page and run queries in the Intermediate EcommerceExplore.
  • save_looks (and its parent permission, save_content ): Save the visualization as a Look.
  • see_looks : View the Look that you'll create in this quickstart.

To navigate to the Intermediate EcommerceExplore, follow these steps:

  1. In Looker, click Main menu to expand the main navigation menu.
  2. In the main navigation menu, select Explore.
  3. Expand Z) Sample LookML(or the corresponding model name on your instance) to expand the list of Explores.
  4. Click 2) Intermediate EcommerceExplore to open the Explore page.

Select fields and pivot data

To build the query, follow these steps:

  1. In the field picker, expand the Order Itemssection.
  2. In the Dimensionssection of the field picker, expand Created At Date, and then hold your cursor over the Weekfield and select the Pivot dataiconto display the weeks as columns in the results table.
  3. Expand Other Dates, and then select the Shipped to Delivered Daysfield to show how long it took each order to be delivered after it was shipped.
  4. In the Measuressection of the field picker, select the # of Order Itemsfield to show the total number of order items for each combination of week and shipping duration.

Add filters and run the query

Next, you will add filters on the following fields to refine the query results:

  • Created At Week: The filter on this field will have the condition is in the last 8 weeks , which includes only data from the past 8 weeks.
  • Shipped to Delivered Days:
    • The first filter on this field will have the condition is not null , which excludes null values.
    • The second filter on this field will have the condition is >2 , which includes only shipping durations that are longer than 2 days.

To apply these filters to your query, follow these steps:

  1. For each filter, in the Filterssection of the Explore page, click + Filterto open the Add Filterwindow.
  2. In the Add Filterwindow, create each filter by selecting the appropriate condition and adding filter values as needed:
    • For the first filter, select the Created At Weekfield and choose the is in the lastcondition. In the text input field, enter the value 8 , and select weeksfrom the list of timeframes.
    • For the next filter, select the Shipped to Delivered Daysfield and choose the is not nullcondition.
    • For the final filter, select the Shipped to Delivered Daysfield. For the filter condition, select is >. In the text input field, enter the value 2 .
  3. Click Runto run the query and display the results.

The Datasection of the Explore now shows the number of order items for each shipping duration over the past eight weeks.

Customize the visualization

Before saving the visualization as a Look, change the default chart type to a table chart and apply conditional formatting to highlight potential shipping delays. To make these changes, follow these steps:

  1. In the Visualizationsection of the Explore page, click the Visualizationsbar to open the visualization editor.
  2. In the Visualizationmenu, select Tableto display the query results as a table chart.
  3. Click Edit to open the visualization editor.
  4. In the Seriestab, expand Order Items # of Itemsand disable the Cell Visualizationoption .
  5. In the Formattingtab of the visualization editor, confirm that the Enable conditional formattingoption is enabled.
  6. In the Rulessection of the Formattingtab, if there is an existing conditional formatting rule, replace the default conditions with the following conditions. If there are no rules, click Add a Ruleto create a new custom formatting rule and apply the following conditions.

    • In the Apply tosection, choose Select fields...and enter the Order Items # of Order Itemsfield in the text input field.
    • In the Formatsection, choose the If value is greater thancondition and enter the value 200 .
    • In the Stylessection, select the existing color swatch in the Background colorsection, and then select a background color (in this example, select the color red).
  7. Click Add Ruleto save the conditional formatting rule.

Now that you've customized the visualization and applied conditional formatting, Looker highlights cells in the table chart where more than 200 order items took more than two days to be delivered.

Save the visualization as a Look

To save the table chart as a Look, follow these steps:

  1. Click the Explore actionsgear icon in the Explore header.
  2. Select Save..., and then select As a Look.
  3. In the Save Lookwindow, enter a title for the Look in the Titlefield.
  4. In the Foldersection, choose a folder to save the Look to.
  5. Click Saveto save the Look to that folder, or click Save & View Lookto save and immediately open the Look.

Now that you've saved the visualization as a Look, you can access it again for further analysis, share it with others, or incorporate it into dashboards for broader visibility. You can also use the Look in a dashboard, as described in the Build a dashboard with sample data .

What's next

Create a Mobile Website
View Site in Mobile | Classic
Share by: