1 Reply Latest reply on Mar 20, 2013 10:40 AM by Jim Wahl

    Histogram Sum of Count Calculation

    Ali Ladak

      Hi I am trying to get a histogram chart on Tableau to work and am coming up with an aggregation error. I've searched through the forum and haven't found the answer. Sorry if this has already been posted.

       

      Brand

      Unique ID

      Total Purchased

      Tylenol

      1234

      98

      Advil

      1235

      5

      Generic

      1236

      50

      Tylenol

      1237

      98

      Advil

      1238

      1

      Generic

      1239

      98

      Tylenol

      1240

      76

       

      I would like the histogram to show a total count of Total Purchase by Brand. For example, I would like the chart to show me how many times 98 units of Tylenol were purchased.  Followed by how many times 76 units of Tylenol were purchased and so on for each Brand.

      When creating the histogram, the units sum up with the totals found from the previous Brand. For example, if the histogram started with Tylenol, followed by Generic, Tylenol would have a count of 2 for Total Purchased equaling 98. Generic would then have a count of 3 (when it should be 1) for Total Purchased equaling 98.

       

      Does anyone have a solution for this?

       

      Thanks for all your help!

        • 1. Re: Histogram Sum of Count Calculation
          Jim Wahl

          What if you use number of records for the count?

           

          To create rows of histograms, you'd add Brand to the rows shelf, Total Purchased (as a blue-pill discrete dimension) to the columns shelf, and SUM(Number of records) to the Rows.

           

          You can also bin the values by right-clicking on Total Purchased > Create Bins.

           

          Jim