User Guide Getting Started Help Center Documentation Community Training
Looker
  
English
Français
Deutsch
日本語
Adding Custom Fields

Most fields in the field picker are created by your Looker developers. Using custom field, however, you can add new custom dimensions and measures yourself. Unlike table calculations, a new custom field becomes a new field picker choice on that Explore for certain users.

To use custom fields, your Looker admin must:

  1. Create a group called Custom Fields Beta Users
  2. Enable the Custom Fields Labs feature
  3. Add users to the Custom Fields Beta Users group

When you have access to custom fields, there are several types of custom fields you can create:

Creating a Custom Measure from a Dimension

There are two ways to create a custom measure from a dimension: using the dimension’s gear menu and using the Custom Fields section.

Using the Dimension’s Gear Menu

In many cases, you can use this shortcut technique:

  1. Expand the view with the dimension that you want to measure. The dimension cannot be a custom dimension. In this example, we want to do a calculation on the Sale Price dimension.
  2. Click the dimension’s gear menu. (To see the gear menu, your admin has to enable custom fields and give you the right to create them.)
  3. Select a function. In this example, we chose Sum to create a measure that calculates the sum of the order amounts. The suggested functions vary based on the type of dimension you’ve chosen (such as number, text, and date). Your new field is automatically added to the query.
  4. Expand the Custom Fields section to see your new field.
  5. As with other measures, you can click a custom measure’s name to display it in a query. You can also click its Filter button to use it as a filter in a query.

Using the Custom Fields Section

If you want to define a format or a filter for your custom measure while creating it, start with the New button on the Custom Fields section:

  1. Expand the Custom Filters section.
  2. Click New.
  3. Choose Custom Measure.
  4. Specify the name, format, dimension, and measure type that you want to use. If you want to add a custom filter, click Custom Filter and type a Looker expression, using any Looker functions and operators that can be used in other custom filters. The editor will suggest field names and give syntax help for any functions you use. For more information on filling out these fields, see the Editing a Custom Field section of this page.
  5. Click Save.

The field picker displays your new custom measure in the Custom Fields section. As with other measures, you can click a custom measure’s name to display it in a query. You can also click its Filter button to use it as a filter in a query.

Creating a Filtered Custom Measure From Another Measure

To create a custom measure that copies an existing measure and adds a filter:

  1. Expand the view with the measure that you want to copy. The measure cannot be a custom measure. In this example, we want to copy the Average Days to Process measure.
  2. Click that measure’s gear menu. (To see the gear menu, your admin has to enable custom fields and give you the right to create them.)
  3. Click Filter Measure.
  4. Modify the name and provide the filter expression, using any Looker functions and operators that can be used in other custom filters. The editor will suggest field names and give syntax help for any functions you use.
  5. Click Save.

The field picker displays the new measure in the Custom Fields section. As with other measures, you can click a custom measure’s name to display it in a query. You can also click its Filter button to use it as a filter in a query.

Creating a Custom Dimension Using a Looker Expression

To create a custom dimension using a Looker expression and one or more other dimensions:

  1. Expand the Custom Filters section.
  2. Click New.
  3. Choose Custom Dimension.
  4. Specify the name and format that you want to use. In the main box, type a Looker expression that calculates the value for your dimension, using any Looker functions and operators that can be used in other custom filters. The editor will suggest field names and give syntax help for any functions you use.
  5. Click Save.

The field picker displays your new custom dimension in the Custom Fields section. As with other dimensions, you can click a custom dimension’s name to display it in a query. You can also click its Filter button to use it as a filter in a query.

Viewing and Using Custom Fields

When you can see custom fields, and how you can interact with them, will be different depending on whether you are allowed to create them or not.

Viewing Custom Fields

If you are allowed to create custom fields, then you can see and edit any that appear in the Custom Fields section of the field picker.

If you are not allowed to create custom fields, then the Custom Fields section is not displayed in the field picker.

However, if you include a custom field in an Explore, Look, or dashboard tile, any users with whom you then share that content can see the custom field regardless of whether they have the ability to create custom fields. If you are sharing this content by sharing an Explore’s URL, the URL must include the qid parameter (such as myinstance.looker.com/explore/ec/order_items?qid=lEPPueGN7cHkozOEZVDQbO). Users who aren’t allowed to create custom fields will see only the field’s title, not its description, so it’s important to name fields precisely if you’ll be using them in queries shared with these users.

Using Custom Fields

If you are allowed to create custom fields, then you can edit and use any that appear in the Custom Fields section of the field picker. You can interact with them as you would with any other measures or dimensions, including filtering on them, adding them to visualizations, and (for custom dimensions) using them as pivots. Only users who are allowed to create custom fields can add them to queries in Explores, Looks, or dashboard tiles.

However, if a user clicks Explore from here on a shared Look or dashboard tile that includes a custom field, they can create a new query using that field regardless of whether they have the ability to create custom fields.

Editing a Custom Field

If you are allowed to create custom fields, you also can edit custom fields that you or other users have created.

Changing a Custom Field’s Name, Format, Field, or Function

To edit a custom field:

  1. In the field picker, expand the Custom Fields section.
  2. Click the gear menu for the custom field you want to delete.
  3. Select Edit.
  4. To change the field name, type the new name in the upper left field. If you have changed anything on a custom field, then consider modifying the name to match. A good, clear name is especially critical for users who cannot create custom fields, because they cannot see the field’s description.
  5. To change the value format, click the upper right field and select a format.
  6. To change the field that should be measured, click Field to measure and select the desired field. If you change this, you should typically also change the custom field’s name to match. For example, if you change a Sale Price field to a Cost field, then change the custom field’s name from Sum of Sale Price to Sum of Cost.
  7. To change the type of function, click Measure type and select the desired function. If you change this, you should typically also change the custom field’s name to match. For example, if you change a Sum function to an Average function, then change the custom field’s name from Sum of Sale Price to Average of Sale Price.
  8. Click Save.

Adding a Custom Filter to a Custom Field

You can add a custom filter for a measure to limit the data, such as only including orders from certain regions. To add a filter to a custom field:

  1. In the field picker, expand the Custom Fields section.
  2. Click the gear menu for the custom field you want to delete.
  3. Select Edit.
  4. Click the Custom Filter box.
  5. Provide the filter expression, using any Looker functions and operators that can be used in other custom filters. The editor will suggest field names and give syntax help for any functions you use.
  6. If you change this, you should consider changing the custom field’s name to reflect the new filter condition. In this example, consider changing the field name from Sum of Sale Price to Sum of Sale Price in France or Japan.
  7. Click Save.

Duplicating a Custom Field

If you are allowed to create a custom field, you can also duplicate existing custom fields. Duplicating and then editing custom fields can be helpful if you’d like to create multiple custom fields with only small differences (for example, 30-, 60-, or 90-day sums).

To duplicate a custom field:

  1. In the field picker, expand the Custom Fields section.
  2. Click the gear menu for the custom field you want to duplicate.
  3. Select Duplicate.

The duplicated field appears below the original, using the name of the original field plus the word “Copy” appended to the end. Next, you can edit the duplicated field as described in the preceding section of this page.

Deleting a Custom Field

If you are allowed to create a custom field, you can also delete custom fields you or other users have created. When you delete a custom field, it disappears from the Explore but not from any Looks or dashboard tiles that use that field. Also, anyone using a URL for an Explore that had the custom field will still have the field.

To delete a custom field from the field picker:

  1. In the field picker, expand the Custom Fields section.
  2. Click the gear menu for the custom field you want to delete.
  3. Select Delete.
  4. Click OK to confirm deleting the field. Looker removes the field from the field picker and the current query (if included).

You can also use the keyboard shortcuts Command-K (Mac) or Ctrl+K (Windows) to delete custom fields.

You can reinstate a custom field that you’ve deleted by clicking the “back” arrow on your browser.

Top