This add-on is pre-installed on Sisense in Linux environments and its version could be different. The download link is for Sisense on Windows.
The Dynamic Buckets add-on supports aggregating a column chart’s results into buckets. This enables you to dynamically or manually segment the result population into groups while still retaining the filtering functionality.
Clicking on a column in the chart selects the specific members that make up the bucket. In the example above, clicking on the column for Customers > $40k will set a filter on the customer dimension and set the selection to each customer that falls within this bucket.
To install the Dynamic Buckets add-on:
- Download the attachment.
- Extract the .zip folder into the plugins folder. If the folder does not exist, create it prior to extracting the .zip file.
For V7.1 and earlier: C:Program FilesSisensePrismWebplugins
For V7.2 and later: C:Program FilesSisenseappplugins
- After those files have been unzipped there, you may also have to restart the web server.
- Create a column chart widget. When creating a column chart widget:
Choose only one category.
In the first value define the measure by which the bucket will be calculated, for example sum(revenue). This value is not reflected in the widget.
In the second measure define the aggregation per bucket, for example count(client) / sum(revenue) / avg(revenue). You can define additional measures.
Click Apply to save the widget.
- In the Widget Editor, enter the script that defines your bucket ranges. There are 2 type of bucket ranges you can define:
A) Manual Ranges: Allows you to manually define the buckets ranges.
Example: The sample below creates the following bucket ranges:
less than 0
greater equal 0
less than 15
greater equal 15
less than 30
greater equal 30
In this example, the following objects are defined as:
<type>: The Range definition. Set it as ‘manual’.
<separator>: Type of separator. Define the separator between the ranges, for example ‘ – ’.
<clickBucketOption>: Define the click bucket option. Set dashboard filters or to export to CSV file. Optional values: 1 or 2.
<ranges>: List of buckets to use.
<bucket>: Provide an object with properties for name, color, min, and max.
var options = {
type: "manual", // (required) Can be 'auto' or 'manual'
separator: " - ", // (optional)
clickBucketOption: 1, // (optional) Can be 1 (default) or 2. 1- sets column categories as filters,
// 2- exports column categories to CSV file.
ranges: [ // Manually define the buckets you want to use
// This will group any values less than 0
{
name: "< $0", // Label for the bucket
color: "#3471AD", // Color can be text or a hex code
min: null, // The lower limit for the bucket, put null for no lower limit
max: 0 // The upper limit for the bucket, put null for no upper limit
},
// This will group any values between 1 & 15
{
name: "$0 - $15",
color: "#F66500",
min: 0,
max: 15
},
// This will group any values between 15 & 30
{
name: "$15 - $30",
color: "#FFC400",
min: 15,
max: 30
},
// This will group any values greater than 30
{
name: "> $30",
color: "#42BC39",
min: 30,
max: null
}
] };
B) Dynamic Ranges: Allows you to define the number of buckets. Ranges will be calculated automatically by the Min and Max of the widget values.
In this example, the following objects are defined as:
< type>: The Range definition.Type of Range. Set as ‘auto’.
<separator>: Type of separator. Define the separator between the ranges, for example ‘-’, ‘to’.
<clickBucketOption>: Define the click bucket option. Set dashboard filters or to export to CSV file. Optional values: 1 or 2.
<numberOfBuckets>: Define the number of buckets.
Example: To define five buckets with dynamic ranges, use this script:
var options = { type: "auto", // (required) Can be 'auto' or 'manual'
separator: " - ", // (optional)
clickBucketOption: 1, // (optional) Can be 1 (default) or 2. 1- sets column categories as dashboard filters
// 2- exports column categories to CSV file."
numberOfBuckets: 5 // (required) How many buckets should we calculate
};
- Add the following code to the end of the script to create the buckets: prism.dynamicBuckets(widget, options )
- Save the script, click Apply and refresh the page. The widget now displays the data divided into buckets you defined.