home User Guide Getting Started Help Center Documentation Community Training Certification
menu
close
settings
Looker keyboard_arrow_down
language keyboard_arrow_down
English
Français
Deutsch
日本語
search
print
Using table calculations with the legacy field picker

This page describes creating table calculations with Looker’s legacy Explore field picker, which must be enabled by an admin to be available to users. Update to the upgraded Explore field picker for smarter search capability, easy view and management of selected fields, Quick Start analyses for Explores with modeled queries, and user experience improvements.

To learn how to create table calculations with the new field picker experience, visit the Using table calculations documentation page.

Table calculations make it easy to create on-the-fly metrics. They are similar to formulas that are found in spreadsheet tools like Excel. Table calculations appear as green columns in the data table, rather than as blue columns (dimensions) or orange columns (measures).

Table calculations can perform mathematical, logical (true/false), lexical (text-based), and date-based calculations on the dimensions, measures, and other table calculations in your query. The formulas that you use to execute these calculations are called Looker expressions.

This page discusses how to use the original Explore field picker to:

The Custom Fields Labs feature must be enabled to be able to use the field picker to perform the above functions with the field picker. Visit the Using table calculations documentation page to learn more about how to create table calculations, edit table calculations, and delete table calculations when the Custom Fields Labs Feature is not enabled, and how to create Quick Calculations, sort table calculations, use them in visualizations, and for other considerations to keep in mind when using them.

Creating table calculations with the legacy field picker

Looker’s Explore page has a built-in Looker expression editor to help you create table calculations, custom fields, and custom filters.

Before you create a table calculation, make sure that all the fields you want to use in the table calculation have been selected from the field picker, and that you have run the query.

If you are a Looker developer creating a data test to verify the logic of your model, you can also use the Looker expression editor to build a Looker expression, then copy the expression into your data test’s expression parameter.

There are two possible ways to access the Looker expression editor from the Explore page, depending on whether your Looker instance is or is not enabled for custom fields.

If your Looker instance is enabled for custom fields and you have the permission to use them, open the Looker expression editor with the following steps:

  1. Open the Custom Fields section of the field picker.
  2. Click New.
  3. Select Table Calculation.

Then, for each table calculation:

  1. Select a calculation type from the Calculation drop-down. The options for a Custom expression are displayed by default.
  2. Add the calculation definition, including selecting a Quick Calculation’s Source field, as desired. Only numeric fields that are selected in the Explore’s data table are eligible for calculation types other than Custom expression.
    • If Custom expression is selected from the Calculation drop-down, start typing a Looker expression in the large text box to create your calculation. You can only create table calculations from fields that are selected in the Explore’s data table. Looker expressions can be quite simple; or they can use as many fields, functions, and operators as your business logic requires. The expression you create can evaluate to a number, date, string (text), or Boolean (true/false).
    • The Creating Looker expressions documentation page explains how to create Looker expressions and how the editor can assist you.
  3. Optionally, click the Format drop-down to choose a predefined format or create a custom format for the results. If you create a custom format, use Excel-style formatting as described on the Adding custom formatting to numeric fields documentation page. If no selection is made, Looker uses a default format.
  4. Rename your table calculation from the default name, if desired. The calculation name appears in the field picker and in the data table.
  5. Click + Add Description to add an optional description of up to 255 characters that can give other users more context or information about the table calculation.
  6. If you are finished adding table calculations, click Save to add the calculation to the Explore.

The field picker also displays your new table calculation in the Custom Fields section. As with other fields, you can click a table calculation’s name to add or remove it from an Explore query.

Duplicating table calculations with the legacy field picker

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

To duplicate a table calculation:

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

The duplicated table calculation appears below the original, using the name of the original table calculation plus the word “Copy” appended to the end:

Next, you can edit the duplicated table calculation, as described below.

Editing table calculations with the legacy field picker

If you’re allowed to create table calculations, you also can edit table calculations that you or other users have created.

To edit a table calculation:

  1. In the field picker, expand The Custom Fields section.
  2. Click the gear menu for the table calculation you want to edit.
  3. Select Edit.

  1. Select a new calculation type from the Calculation drop-down, if desired.
  2. Change the calculation definition, including a Quick Calculation’s Source field, as desired. Only numeric fields that are selected in the Explore’s data table are eligible for calculation types other than Custom expression.
    • If Custom expression is selected from the Calculation drop-down, either add a Looker expression to, or edit an existing Looker expression in, the large text box. You can only create table calculations from fields that are selected in the Explore’s data table.
  3. Select a new format from the Format drop-down, if desired.
  4. Enter a new calculation name, as desired. The calculation name appears in the field picker and in the data table. If you have changed anything on a table calculation, consider modifying the name to match.
  5. Add or update an optional field description of up to 255 characters with details about the table calculation, including its intended use.
    • If there is an existing description, the Description box will automatically appear. If there is no existing description, click + Add Description to add an optional description.
  6. Click Save.

Deleting table calculations with the legacy field picker

If you’re allowed to create table calculations, you can also delete table calculations you or other users have created. When you delete a table calculation, 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 table calculation from the field picker:

  1. In the field picker, expand The Custom Fields section.
  2. Click the gear menu for the table calculation you want to delete.
  3. Select Delete.

  1. Click OK to confirm deletion of the table calculation. Looker removes the table calculation 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