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.
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:
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 a query you want to turn into a dashboard element and edit in the Visualization section:
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.
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:
- 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:
- 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:
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:
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:
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:
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.