Building LookML Dashboards

On this Page
Docs Menu

Looker Dashboards allow you to combine key queries and visualizations into a one page executive view. This tutorial demonstrates the high-level steps to create a LookML Dashboard. LookML Dashboards are defined with LookML code, and stored as version-controlled files associated with the project.

Looker also has User-defined Dashboards, which can be created by non-developer users without LookML coding. For details, refer to Building Dashboards.

See the LookML Visualization Reference for the complete list of supported visualizations and their parameters.

Create File

To create a new dashboard, create a LookML file with the dashboard name:

Edit Dashboard File

Edit the dashboard file header with a name, title, and config preferences:

- dashboard: business_pulse title: Business Pulse layout: grid elements:

See the Dashboard Parameters page for a complete listing of parameters that impact the entire dashboard. For more information on available dashboard element parameters, see the Dashboard Element Parameters page.

Starting in 4.0, you can use New LookML for most modeling. However, LookML dashboards continue to use the YAML-based old LookML language.

Build Query

Build a query you want to turn into a dashboard element and edit in the Visualization section:

Copy LookML

Click on Get Dashboard LookML to expose the LookML needed for the dashboard file.

Copy the snippet into the dashboard file, adjusting parameters as needed based on the LookML Visualization Reference.

Adding Filters

Once you have multiple dashboard elements saved in your dashboard file, you may want to add dashboard filters, which allows users to filter some or all elements on a dashboard. They can be useful for many possible reasons, for example:

  • Adjusting the time period shown
  • Adjusting the specific product category, customer type, etc being shown
  • Providing a “lookup” type capability for a client or customer

One point of confusion to avoid is that there are two types of filters:

  1. There are filters that you hard-code into the dashboard elements, which users cannot change. They usually get created automatically in the copy LookML step, and look like this:
- name: element_name # lots of other element parameters here filters: dimension_or_measure_name: 'looker filter expression'
  1. There are also filters that you add to the top of a dashboard, which users can change. You’ll have to create them as described next.

If you decide you want filters that a user can change, the first step is to create the filters they they interact with. To do so, add a filters section to your dashboard file, which will look something like this:

- dashboard: dashboard_name # possibly some other dashboard parameters here filters: - name: date title: 'Date Range' type: date_filter default_value: 30 days - name: category_name type: field_filter model: ecommerce explore: product field:

The various options and parameters for these filters are described in more detail in the Dashboard LookML Reference. One of the most important things to keep in mind is what type of input you’re expecting from your users. You can assign a type that will accept numbers, dates, or strings. Or, you can associate your filter with an underlying LookML field, in which case Looker will automatically select the correct type of input and give suggestions to your users when applicable.

At this point in the process the filters don’t do anything yet!

After you create your filters, you’ll need to apply them to the proper elements using the listen parameter. The idea is that the element “listens” to one or more filters for user input, then adjusts accordingly.

For example, you may have an element that looks like this:

- name: approved_orders_by_day type: looker_area model: ecommerce explore: order dimensions: [order.created_date] measures: [order.count] filters: order.status: 'approved'

You can see that this element already has a filters parameter that restricts the element to approved orders. This can’t be changed by the user.

Suppose you wanted the user to be able to restrict this element to a certain date range, or a certain category, based on the dashboard filters you created. You would need to add a listen parameter like this:

- name: approved_orders_by_day type: looker_area model: ecommerce explore: order dimensions: [order.created_date] measures: [order.count] filters: order.status: 'approved' listen: category_name: date: order.created_date

If you don’t want users to be able to adjust the date or category, simply don’t add the listen parameter. You only have to add a listen to elements that you want the user to be able to adjust.

You’ll see that the listen syntax works by first writing the name of the filter you created, then writing the name of the field that you want to apply the user input to.

Keep in mind that a dashboard filter can be applied to any field (of the same data type) in any given element. For example, one element can apply a user’s input to the order created date, while another applies it to the order ship date:

- name: element_one # lots of other element parameters here listen: date: order.created_date - name: element_two # lots of other element parameters here listen: date: order.ship_date

Save File and Preview

Save the file, preview the dashboard, and commit your changes via Git to put the dashboard into production mode when you are ready.

Still have questions?
Go to Discourse - or - Email Support