Building LookML Dashboards

On this Page
Docs Menu

A Looker dashboard is a collection of saved Looks, displayed all on one page. Dashboards let you combine key queries and visualizations into a one page executive view. You can add filters to make the dashboard interactive and rearrange its tiles. You can create as many dashboards as you want, so you can tailor each dashboard to the specific needs of the people who use it.

Types of Dashboards: User-defined and LookML

There are two types of Looker dashboards, LookML dashboards and user-defined dashboards:

Characteristic User-defined Dashboard LookML Dashboard
Generally created and edited by Business users and developers A select group of LookML developers
Defined By picking saved Looks in the user interface, arranging them using drag-and-drop operations, and choosing dashboard settings (as described on the Creating User-defined Dashboards page) Written and edited in a YAML-based dashboard.lookml file as described below on this page
Updated When the dashboard is edited or the corresponding saved Looks are updated When the LookML file for the dashboard is edited
Stored Stored in user's personal Space or a Shared Space for easy collaboration across a wider group of users Stored as version-controlled files associated with the project in a Git repository and accessed using the LookML Dashboard option on the Browse page. The file can be ported to another Looker instance.
Converting ADDED4.12 Convertible to LookML dashboards as described below Convertible to user-defined dashboards, as explained on the Converting from LookML to User-defined Dashboards page

Creating a LookML Dashboard File

To create a new LookML dashboard:

  1. Turn on Development Mode.
  2. Navigate to the project in the Develop menu.
  3. Click + next to Add Files.
  4. Click Create Dashboard.
  5. Name the dashboard file and press return.

Manually Building or Modifying a LookML Dashboard

Edit the dashboard file header with a name, title, and configuration 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 data modeling. However, LookML dashboards continue to use the YAML-based old LookML language.

Create a LookML Copy of a User-defined Dashboard

You can copy the LookML of an entire user-defined dashboard, which lets you use the dashboard across Looker instances and across models. Having the dashboard in LookML also lets you to use version control for the dashboard, as with other LookML files.

To create a LookML dashboard from a user-defined dashboard:

  1. Navigate to the user-defined dashboard. If you created the dashboard and have never moved any tiles, then edit the dashboard and move a tile to a new location (and back, if desired). This sets the tiles' location settings.
  2. Click the dashboard gear menu.
  3. Select Get Dashboard LookML.
  4. In the Dashboard LookML window, click on Copy to Clipboard.
  5. Click + next to Add Files.
  6. Click Create Dashboard.
  7. Name the dashboard file and press return.
  8. Delete the initial contents of the new LookML dashboard file.
  9. Paste the copied LookML from your clipboard into the file.
  10. Save the new LookML dashboard file.

Adding a Visualization to an Existing LookML Dashboard

The easiest way to add a tile to an existing LookML dashboard is to use the Explore page to build a query you want to turn into a dashboard element, optionally saving the query as a Look:

Then, click on Get Dashboard LookML to expose the LookML needed for the dashboard file.

Copy the snippet into the dashboard file, adjusting parameters if desired, using 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 lets 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

Be sure to build the type of filter you want. The two types are:

  • filters that you hard-code into the dashboard elements, which users cannot change.
  • filters that you add to the top of a dashboard, which users can change.

Filters that you hard-code into the dashboard elements, which users cannot change, usually get created automatically in the copy LookML step for a visualization or a for a dashboard. In a LookML dashboard, those filters look like this:

- name: element_name # lots of other element parameters here filters: dimension_or_measure_name: 'looker filter expression'

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: category.name

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, when applicable, give suggestions to your users.

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: 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

Saving and Previewing the File

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

Extending a LookML Dashboard

Once you create a LookML Dashboard, you can extend the dashboard. This enables you to create a second dashboard based on the original one, possibly adding or overriding some settings. Then if you change the first dashboard, the second one inherits those changes automatically (unless overridden in the second dashboard.) See this page for more information.

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