Notification

This Help Center is moving to Cloud. Learn more.

Create a custom bin

Create ad hoc integer ranges for dimensions without needing to develop or code logical expressions.

The Bin calculated field type lets you create ad hoc numeric tiers for numeric dimensions without needing to develop CASE WHEN expressions in calculated fields or logic in SQL.

The Bin calculated field type can be helpful when you want to quickly group values into specific integer ranges to adjust the granularity of your data.

This page provides an overview of how to perform the following tasks:

For more information related to custom bins, see the Related resources section on this page and the Create a custom bin example on the About calculated fields page.

Create a custom bin in your data source

You must have edit rights to the data source to create and edit calculated fields.

Custom bins that are created in data sources are available in any report that uses that data source. To create a custom bin in a data source, follow these steps:

  1. Edit the data source.
  2. Click "Create new" button ADD A FIELD.
  3. Select Add bin.
  4. Select an existing field to bin by from the Selected field to bin by drop-down menu.
  5. Select a format for the bin from the Bin field format drop-down menu. Options include:
    • Interval "[x,y)" -- This format displays the range including x, and up to but not including y.
    • Integer "x to y" --This format must be used with discrete integer values (such as age). 
    • Relational ">=x and < y" -- This format is best used with continuous numbers (such as dollars).
  6. Specify a name in the New field name field.
    • This name is the default name that appears in your reports. You can change the field name for individual charts by editing the name in the dimension picker.
    • The field name must be unique.
    • You can't use a reserved keyword as the field name.
  7. Edit the default ID provided in the New field ID field, as desired. This ID is used by Looker Studio to identify a field as an alternative to the field name.
  8. As an optional starting point, select Refresh field info to learn more about the values for the dimension for which you're creating custom bins, including the dimension's minimum and maximum values. Having this information can be helpful in determining the way in which you specify value bins.

    Warning: A maximum of 195 total bins can be created for each Bin field type.
  9. Specify a Bin type.

    • Select Equal Sized to bin numeric values into equal integer ranges. For example, tiers of values that range from 0-10, 10-20, and 20-30.
    • Select Custom Sized to create custom bin sizes of varying integer ranges. For example, tiers of values that range from 0-15, 15-75, and 75-100.
  10. Customize the bin sizes and ranges. 
    • If the selected Bin type is Equal Sized, enter the desired values in the Bin sizeMinimum value, and Maximum value fields.
    • If the selected Bin type is Custom Sized, specify the tier breakpoints in ascending order in the Bin breakpoints box, separated either by commas or by pressing the Enter key (PC) or Return key (Mac). You can also use the Tab key.
  11. Optionally, select the Bin remaining values outside the min and max as separate bins checkbox to create a category for grouping all other values that don't satisfy any of the group conditions. 
  12. Click Save.

Create a custom bin in your data source from a report

Alternatively, you can create a custom bin in your data source from a report by following these steps:

  1. Create or edit your report.
  2. In the Data panel, click "Create new" button Add a field.
  3. Select Add bin.
  4. Select an existing field to bin by from the Selected field to bin by drop-down menu.
  5. Select a format for the bin from the Bin field format drop-down menu. Options include:
    • Interval "[x,y)" -- This format displays the range including x, and up to but not including y
    • Integer "x to y" --This format must be used with discrete integer values (such as age). 
    • Relational ">=x and < y" -- This format is best used with continuous numbers (such as dollars).
  6. Specify a name in the New field name field.
    • This name is the default name that appears in your reports. You can change the field name for individual charts by editing the name in the dimension picker.
    • The field name must be unique.
    • You can't use a reserved keyword as the field name.
  7. Edit the default ID provided in the New field ID field, as desired. This ID is used by Looker Studio to identify a field as an alternative to the field name.
  8. As an optional starting point, click Refresh field info to learn more about the values for the dimension for which you're creating custom bins, including the dimension's minimum and maximum values. Having this information can be helpful in determining the way in which you specify value bins.

    Warning: A maximum of 195 total bins can be created for each Bin field type.
  9. Specify a Bin type.

    • Select Equal Sized to bin numeric values into equal integer ranges. For example, tiers of values ranging from 0-10, 10-20, and 20-30.
    • Select Custom Sized to create custom bin sizes of varying integer ranges. For example, tiers of values ranging from 0-15, 15-75, and 75-100.
  10. Customize the bin sizes and ranges. 
    • If the selected Bin type is Equal Sized, enter the desired values in the Bin sizeMinimum value, and Maximum value fields.
    • If the selected Bin type is Custom Sized, specify the tier breakpoints in ascending order in the Bin breakpoints box, separated either by commas or by pressing the Enter key (PC) or Return key (Mac). You can also use the Tab key.
  11. Optionally, select the Bin remaining values outside the min and max as separate bins checkbox to create a category for grouping all other values that don't satisfy any group conditions. 
  12. Click Save.
Learn more about what you can do with calculated fields, and the difference between calculated fields that are created in a data source versus chart-specific calculated fields.

See the Create a custom bin example on the About calculated fields page.

Edit a custom bin in your data source

You must have edit rights to the data source to create and edit calculated fields.

Custom bins and calculated fields appear in the data source with an fx symbol. To edit the formula, click fx next to the field name to open the formula editor, where you can adjust the field as needed.

On the Edit Connection menu field list, a user selects the fx icon to open the formula editor for the calculated field called My Calculated Field.

Create a chart-specific custom bin

Field Editing in Reports must be enabled in the data source.

You must have edit rights to the report to create and edit calculated fields.

You can't reference other chart-specific calculated fields.

Chart-specific custom bins exist only in the chart in which you create them.

To create a chart-specific custom bin, follow these steps:

  1. Create or edit your report.
  2. Add a new chart or select an existing chart.
  3. In the Setup tab of the Properties panel, click + Add dimension.
  4. At the bottom of the field list, click + ADD BIN.
  5. Select an existing field to bin by from the Selected field to bin by drop-down menu.
  6. Select a format for the bin from the Bin field format drop-down menu. Options include:
    • Interval "[x,y)" -- This format displays the range including x, and up to but not including y.
    • Integer "x to y" --This format must be used with discrete integer values (such as age). 
    • Relational ">=x and < y" -- This format is best used with continuous numbers (such as dollars).
  7. Specify a name in the New field name field.
    • This name is the default name that appears in your reports. You can change this for individual charts by editing the name in the dimension picker.
    • The field name must be unique.
    • You can't use a reserved keyword as the field name.
  8. As an optional starting point, click Refresh field info to learn more about the values for the dimension for which you're creating custom bins, including the dimension's minimum and maximum values. Having this information can be helpful in determining the way in which you specify value bins.

    Warning: A maximum of 195 total bins can be created for each Bin field type.
  9. Specify a Bin type.

    • Select Equal Sized to bin numeric values into equal integer ranges. For example, tiers of values that range from 0-10, 10-20, and 20-30.
    • Select Custom Sized to create custom bin sizes of varying integer ranges. For example, tiers of values that range from 0-15, 15-75, and 75-100.
  10. Customize the bin sizes and ranges. 
    • If the selected Bin type is Equal Sized, enter the desired values in the Bin sizeMinimum value, and Maximum value fields.
    • If the selected Bin type is Custom Sized, specify the tier breakpoints in ascending order in the Bin breakpoints box, separated either by commas or by pressing the Enter key (PC) or Return key (Mac). You can also use the Tab key.
  11. Optionally, select the Bin remaining values outside the min and max as separate bins checkbox to create a category for grouping all other values that don't satisfy any group conditions. 
  12. Click Save.
Learn more about what you can do with calculated fields, and the difference between calculated fields that are created in a data source versus chart-specific calculated fields.

Edit a chart-specific custom bin

You must have edit rights to the report to create and edit calculated fields.

Chart-specific calculated fields appear in the chart Properties panel on the Setup tab.

When you hover your cursor over the field type next to the field name, an fx symbol will appear. To edit the formula, click fx to bring up the formula editor, where you can adjust the field as needed.

Reuse a chart-specific custom bin

Chart-specific calculated fields exist only in the chart in which you create them. You can't directly reuse a chart-specific calculated field or reference it in other calculated fields.

However, you can copy a chart that contains chart-specific calculated fields. The copy will contain any calculated fields that are defined in the original. You can then edit them as needed in the new chart.

Related resources

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu