This page refers to the
description
parameter that is part of a field.
description
can also be used as part of an Explore, described on this documentation page.
description
can also be used as part of a dashboard, described on this documentation page.
Usage
dimension: field_name {
description: "description string"
}
}
Hierarchydescription |
Possible Field TypesDimension, Dimension Group, Measure, Filter, ParameterAcceptsA string |
Definition
You can add a description to any field. The user can see this description in multiple places.
In the Field Picker, Looker displays this description if a user hovers over the help link, which is to the right of the field name. For example, this LookML:
will give this result in the Looker UI:
In addition, the description is displayed when the user hovers over the column name in a table or table chart visualization in an Explore, a dashboard, or a Look:
Using Liquid Variables in the description
Parameter
You can use Liquid variables with the description
parameter for a field. This is useful, for example, when you want Looker to display a different description for a field based on a user attribute, or based on the Explore in which a query is run.
For example, if you want the description for a field to differ depending on the Explore in which a query is run, you can use the Liquid variable _explore._name
within a Liquid {% if %}
{% else %}
{% endif %}
structure:
In this example, if a query is run in the Order Items Explore, the description for the User ID dimension will be The user ID for the Order Items Explore. In the Inventory Items Explore, the description will be The user ID for the Inventory Items Explore. In any other Explore, the description The user ID will be displayed.
As another example, suppose you want to display different descriptions to different users depending on their departments. If you have defined a user attribute called Department, you can use the Liquid variable _user_attributes['name_of_attribute']
within a Liquid {% if %}
{% else %}
{% endif %}
structure to specify a different description depending on the value of the Department user attribute:
In this example, the description displayed for the Gross Margin dimension differs depending on whether a user is part of Marketing, Sales, or some other team.
You can use Liquid variables like _model._name
, _view._name
, _explore._name
, _field._name
, and _user_attributes['name_of_attribute']
with the description
parameter. See the Liquid Variable Reference documentation page for more information on using Liquid parameters with LookML, and to see which Liquid variables can be used with the description
parameter.
Things to Know
The Description Displays Once per Dimension Group
For a dimension group, Looker displays the description only once for the entire group, and not for each timeframe dimension within the group.