KNOWLEDGE BASE

Histogram of Aggregated Values


Published: 21 Aug 2013
Last Modified Date: 30 Nov 2016

Question

How to create a histogram of aggregated values.

Environment

Tableau Desktop

Answer

 The following instructions create a histogram using the sum of sales per day.

  1. Select Analysis > Create Calculated Field.
  2. In the calculated field dialog box:
    1. Name the calculated field. In this example, the calculated field is named Day Date.
    2. In the formula field, create a calculation similar to the following: DATETRUNC('day', [Order Date])
    3. Click OK.
  3. Select Analysis > Create Calculated Field.
  4. In the Calculated Field dialog box:
    1. Name the calculated field. In this example, the calculated field is named Sales per Day.
    2. In the formula field, create a calculation similar to the following: {FIXED [Day Date] : SUM([Sales])}
    3. Click OK.
  5. Right-click on Sales per Day in the data pane and select Create > Bins….
  6. In the Create Bins dialog:
    1. Name the Bins field as desired.
    2. Enter the desired bin size.
    3. Click Load to populate Min, Diff, and Max.
  7. Drag Sales per Day (bin) to Columns.
  8. Drag SUM(Sales) to Rows.
  9. Optional: Right-click on the bin labels on the view and select Edit Alias….
    1. Enter the desired name for the bin label.
    2. Click OK.
Did this article resolve the issue?