Skip to main content
All CollectionsGetting Started
Create groups of things based on the value of a metric
Create groups of things based on the value of a metric

Sometimes you need to put things into buckets based on the value of a metric in your data. Here’s how you do that.

Ken Hilburn avatar
Written by Ken Hilburn
Updated over 2 years ago

What is a "Grouped Dimension"?

Data is grouped by dimensions. For example:

  • Teams

  • Dates

  • States

These groupings help us understand how measures (the numbers in our data) are rolled up:

  • Dollars Sold by Team

  • People signed up by Date

  • Voters by State

But sometimes the dimensions in your data aren't grouped quite right for the story you’re trying to tell. This is where you should create new groupings like these:

  • Department — a collection of Teams (which results in Dollars Sold by Department)

  • Reporting Period — a collection of Dates (which results in People signed up by Reporting Period)

  • Region — a collection of States (which results in Voters by Region)

How to create a Grouped Dimension based on Metric value

In order to create a new aggregated grouping, I'll create an Advanced Column and use Bucketed Dimensions. Here's the sample data I'll use:

I want to group all the items in the data by sales dollars achievement level into these new buckets:

  • Under Target: Sales below $8,000

  • On Target: Sales $8,000 up to $12,000

  • Above Target: Sales $12,000 and up

After loading the data, I’ll edit a column. I'll pick a column that relates to the grouping I want to create; in this case I'll use the "Team" dimension column. By clicking on the “…" menu in the upper right of the column editor I can select select “Duplicate as Advanced” which make a special type of column called an Advanced Column.

In the advanced column text box, I'm going to tell it which other column I want to bucket by (the metric "Sales" in this case) by changing the row that says “field:” to reference that metric.

field: Sales

Now I'll add my new bucket configuration to set up the ranges for my buckets.

buckets:
- label: Under Target
condition: <8000
- label: On Target
condition: <12000
buckets_default_label: Over Target

Here's what the Advanced Column text looks like when I'm finished:

While we are using a metric to bucket our data, the resulting advanced column is a dimension, as shown by the line that says "kind: Dimension". I've named the new dimension “Sales Achievement Buckets” and clicked “Save Definition”. Now here’s the data (in a Juicebox Table) with the new bucketed dimension "Sales Achievement Bucket":

And here’s how those new buckets show up in a Bar chart:

For more options on how to bucket based on value, check out the Defining conditions section of our Juicebox documentation.

Did this answer your question?