User Guide Getting Started Help Center Documentation Community Training
New LookML
Old LookML
New LookML
Looker
  
English
Français
Deutsch
日本語
description (for Fields)

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

view: view_name {
  dimension: field_name {
    description: "description string"
  }
}

Hierarchy

description

Possible Field Types

Dimension, Dimension Group, Measure, Filter, Parameter

Accepts

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

dimension: name { description: "The first and last name of the user" sql: CONCAT(${TABLE}.first_name,' ', ${TABLE}.last_name) ;; }

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, dashboard, or 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:

dimension: user_id { description: "{% if _explore._name == 'order_items' %} The user ID for the Order Items Explore {% elsif _explore._name == 'inventory_items' %} The user ID for the Inventory Items Explore {% else %} The user ID {% endif %}" }

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:

dimension: gross_margin { description: "{% if _user_attributes['department'] == 'Marketing' %} The standard margin for a field {% elsif _user_attributes['department'] == 'Sales' %} The operating margin for a field {% else %} The gross margin for a field {% endif %}" type: number value_format_name: usd sql: ${sale_price} - ${inventory_items.cost} ;; }

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.

Top