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.

dynamic-buckets

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:

  1. Download the attachment and unzip the contents into your C:\Program Files\Sisense\PrismWeb\plugins\ folder. If the plugins folder doesn’t exist, just create it. After those files have been unzipped there, you may also have to restart the web server.
  2. 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).
    • 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.
  3. In the Widget Editor, enter the script that defines your bucket ranges. There are 2 type of bucket ranges you can define:
    1. Manual Ranges: Allows you to manually define the buckets ranges.
      Example: The sample below creates the following bucket ranges:

      1. less than 0
      2. greater equal 0 less than 15
      3. greater equal 15 less than 30
      4. 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
    }
    ] };
  1. 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
    };
  1. Add the following code to the end of the script to create the buckets:
    prism.dynamicBuckets(widget, options )
  2. Save the script, click Apply and refresh the page. The widget now displays the data divided into buckets you defined.