Bucket groups for breakdown sources
-
- UpdatedJan 30, 2025
- 4 minutes to read
- Yokohama
- Performance Analytics
Bucket groups are used to recategorize data so it can be used as a breakdown, for example by grouping a range of values into discrete buckets.
In the data architecture, bucket groups are defined in Bucket Group [pa_bucket_groups] records and buckets in Bucket [pa_buckets] records. Each Bucket [pa_buckets] record contains a Bucket Group field that is a reference to a Bucket Group [pa_bucket_groups] record.
To work with a bucket group, create a breakdown source that uses Bucket [pa_buckets] as the facts table and specifies the bucket group in a condition. If a breakdown built on this source uses a breakdown mapping with a script, the breakdown groups the values that the script returns into buckets. If the breakdown mapping specifies a field instead of using a script, the breakdown groups the values of the mapped field into buckets.
Grouping field values into buckets
You can use a bucket group with a breakdown mapping that does not use a script, to group the values of any mapped field to buckets.
The use case can be as simple as translating the true
and
false
values of a boolean into two buckets with meaningful labels.
Example: Sorting boolean values into buckets
A base Performance Analytics installation includes
the Active breakdown as part of the Analytics Usage Overview. This breakdown uses a mapping to
the job.active boolean field from the Job Log [pa_jobs_logs] table. The breakdown source uses a
bucket group where true
values for job.active are sorted into the Active
bucket, while false
values are sorted into the Inactive bucket. Note that
false
values are numerically considered to be a value less than one, while
true
values are numerically one and above.

Grouping script results into buckets
When you have a breakdown mapping script that collects a range of values, you can define a bucket group to divide those values into discrete buckets.
After you create the bucket group, you create a breakdown source based on the bucket group. Then you create a breakdown that uses that breakdown source. When you create the breakdown mapping for the breakdown, define or select a script for the mapping. The breakdown groups the results that the script returns into the buckets of the bucket group. For an example, see Example: Script mapping.
You can write a bucket group for an existing script, or you can first write the bucket group and then write the script. Both must exist before you can create the breakdown.
Create a bucket group
Specify a group of buckets into which you want to recategorize data.
Before you begin
Procedure
Example: Incident Age Ranges bucket group
- Less than a day
- 1–5 days
- 6–30 days
- 31–90 days
- More than 90 days

This bucket will contain incidents from the age of precisely 6 days to the age of 30 days, 23 hours, 59 minutes, and 59 seconds.
At the end, you have a bucket group with five buckets corresponding to the age ranges in which you want to divide incidents.

The Script Mapping example shows a breakdown that uses this bucket group and script.
What to do next
On this page
Related Content
- Create a breakdown mapping on a breakdown record
Specify which field on the indicator source references the breakdown source. If no appropriate field is available, specify a script to query the indicator source.
- Example: Script mapping
The Age breakdown uses the Incident.Age.Days script to calculate the age of incidents in days and map the values to the Incident Age Ranges bucket group.
- Scripting in Performance Analytics
Performance Analytics provides several script objects for use in scripts and APIs for querying Performance Analytics data. The scripts serve as breakdown mappings or to calculate a value from an indicator.