Calculate Histogram

Contents[Hide]

1. Overview

A histogram is a graphical representation of the distribution of numerical data, grouping each value into a "bin" of values close together, and displaying the bin counts across the range of values. Dundas BI can automatically create a formula visualization that calculates and displays the frequencies of values in your dataset.

When to use a histogram?

Use a histogram when you have a single set of numeric values and are interested in which numeric values occur the most or least, and patterns in how the values occur across the total range.

2. Data preparation

Sample data: Sales as measure and Location as hierarchy.

Sample data
Sample data

In this example, you have data showing sales per location, and you want to show in a data visualization the distribution of the frequency of different amount of sales.

3. Calculate Histogram

You can choose to create a histogram visualization based on data that you select or by re-visualizing an existing visualization of a set of numbers:

3.1. Using the Create Histogram option

  1. In the dashboard editor, select the Calculate Histogram option from the toolbar.

    Calculate Histogram button.
    Calculate Histogram button.

  2. Drag and drop the Sales to MEASURES and Location to ROWS.
  3. Select the Create Histogram option from the toolbar.

    Create Histogram button.
    Create Histogram button.

Result:

3.2. Using the Re-visualize to Histogram option

  1. In the dashboard editor, select your existing data visualization and in the toolbar, select "Re-Visualize". You can also right-click on the visualization and select "Re-Visualize".

    Re-Visualize
    Re-Visualize

  2. Select Calculate Histogram

    Calculate Histogram button.
    Calculate Histogram button.

Result:

A new bar chart is created by default, with the histogram formula as measure (the height of the bar corresponds to the frequency of the amount of data), and "Distribution bins" used as hierarchy/bottom axis.

Histogram
Histogram

3.3. Using the Formula Visualization option

Refer to the histogram formula.

4. Data Analysis Panel:

Data Analysis Panel
Data Analysis Panel

The formula generated uses the Histogram function:

Formula
Formula

5. Adding a filter to dynamically change the distribution bin

By default, the bin size parameter of the Histogram formula is assigned a parameter placeholder name of $BinSizeParameter$. This makes it possible to assign this parameter placeholder to a single numeric parameter so that users can dynamically set the bin size. The sample below demonstrates how to add a single numeric filter (i.e. Slider) and connect to the $BinSizeParameter$ placeholder parameter. A Single Number filter can also be used.

  1. Add a Slider filter:

    Add a slider flter control
    Add a slider flter control

  2. Assign to the "(SingleNumber)" parameter under the "Sales Histogram Expression" measure:

    Connect filters
    Connect filters

  3. Set up the Slider properties:

    Set slider properties
    Set slider properties

View the dashboard and use the slider control:

Result
Result

6. Modifying the formula

If you prefer to explicitly set the parameter values, you can modify the formula to set the histogram's distribution bin and format:

Formula - modified
Formula - modified

Optionally, you can use the Histogram Range function to set the start and end range of the distribution bins:

Histogram Range
Histogram Range

7. See also

 

Dundas Data Visualization, Inc.
500-250 Ferrand Drive
Toronto, ON, Canada
M3C 3G8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours: 7am-6pm, ET, Mon-Fri