1 Reply Latest reply on Feb 12, 2016 4:40 AM by Yuriy Fal

    Histogram with distinct counts of number of values in bins

    Robert Lutener

      Hi there everyone,

       

      I have read through about 50 articles but just cant seem to find a solution to this problem.  I have a data set that is structured as such:

       

       

       

      YearIDSectionUnitValueq
      20141093Section1Unit 149358.05
      20141093Section1Unit 288704.95
      201482Section2Unit 141902.74
      201482Section2Unit 255908.12
      201482Section2Unit 337632.93
      2014274Section1Unit 155134.38
      2014274Section1Unit 297290.93
      2014274Section1Unit 351308.23
      2014630Section2Unit 156812.79
      2014630Section2Unit 277500.36
      2014630Section2Unit 342349.07
      20141076Section1Unit 148429.36
      20141076Section1Unit 270115.02
      20141076Section1Unit 340153.74
      201431Section2Unit 153610.93

       

       

      I am trying to create a histogram that counts the distinct number of IDs that have a value that is broken out by the value table.  For example:  My x axis will have bins for 10k, 20k, 30k, 40k, etc and I want the bars to display on the Y axis the count of the number of IDs that have values that fall within these bins.  I need the Section and Unit Dat for further analysis.  My problem is that I can drill down and create views and filter by year and section and unit and get the right count, but even when I use Count Distinct on the IDs I am still getting numbers that are way out of whack.  I looks like it is counting each combination as a distinct value.  Yes I have done an extract for it.  The source is an Excel spreadsheet.

       

      Attached is a sample workbook with mocked up data.  Any help that could be given on this issue would be much appreciated.

       

      Thanks.

        • 1. Re: Histogram with distinct counts of number of values in bins
          Yuriy Fal

          Hi Robert,

           

          You're right, Tableau defines a view granularity

          (and the number of Marks to draw on canvas)

          from all unique value combinations

          of all Dimension pills on a view.

           

          [Valueq (bin)] is a Dimension, too (though a special one).

          So if one place both [ID] and [Valueq (bin)] on a view (Sheet 7)

          and filter [Year] = 2013, the number of Marks on a view would be 350 --

          each Mark is a combination of unique values of [ID] and [Valueq (bin)].

          The aggregation COUNTD([ID]) is calculated for each Mark.

          So your 164 unique IDs are counted in one or more Marks --

          same ID, different Valueq (bin). When other dimensions on a view --

          Marks are drawn different, so distinct IDs are counted different.

           

          I couldn't find a problem here.

          What exactly is your concern?

           

          Yours,

          Yuri

           

          PS Workbook w/Sheet 7 attached.

          1 of 1 people found this helpful