label (for views)

This page refers to the label parameter that is part of a view.

label can also be used as part of a model, described on the Model parameters documentation page.

label can also be used as part of an Explore, described on the label (for Explores) parameter documentation page.

label can also be used as part of a field, described on thelabel (for fields) parameter documentation page.

label can also be used as part of a reference line, described on the Dashboard reference line parameters documentation page.

Usage

view: view_name {
  label: "desired label for the view"
}
Hierarchy
label
Default Value
The view name

Accepts
A string

Definition

The label parameter helps make Explores more user-friendly by allowing you to set the view names that appear in the field picker. If not specified, the label defaults to the name of the view.

Example

In the field picker, make the view appear as Product ID Info for a view named product_id_information:

view: product_id_information {
  label: "Product ID Info"
}

Things to consider

A label does not change LookML references

The label affects only the displayed name of the view in the Explore; the label does not affect how you refer to the view in LookML. Views with labels are still referenced with the normal ${view_name.field_name} syntax in your LookML files.

A label can affect multiple Explores

Unlike view_label (for Explores) and view_label (for joins), this parameter affects all Explores that use the view.

A label isn't necessary if you name views thoughtfully

A view does not need a label parameter if the name already appears and is formatted how you want your users to see it in the field picker. If you know how you want a view to appear to your users, you can often consider this when naming it, avoiding the need to use label.

Typically label is only used when you want to perform one of the following tasks:

  • Change the way that a view name is formatted. For example, you can make the view name "abc_info" appear as "ABC Info" instead of "Abc Info"
  • Create two different views with different dimensions and measures that are based on the same SQL table