3 Replies Latest reply on Oct 29, 2018 2:32 AM by Yuriy Fal

    Histograms with limits

    Ivan Johansson



      I have asked this question before but no answer so far has been acceptable or a solution for me. I have attached a workbook.


      What I need is to have a histogram for each Quantityname   with the respective limits included in the diagram. I have been able to add a second axis, a dual axis but then I can't syncronize them.


        • 1. Re: Histograms with limits
          Yuriy Fal

          Hi Ivan,


          You couldn't do Synchronize Axis if Pills are of different Data Type.

          The [Value (bin)] pill is an INTEGER, while the Value is FLOATING POINT --

          a Number (Decimal) as defined in Tableau.


          You can change a date type for the [Value] to a Number (Whole),

          or use a calculation like INT( [Value] ) or even INT( ROUND( [Value] ) )

          for the [Value] Dimension Pill in Columns to have the ability to Sync.

          You can't do any changes to the Tableau-generated [Value (Bin)] Pill, though.


          BTW, the problem has been solved

          (the Sync behaviour has been changed)

          in the recent versions of Tableau.




          • 2. Re: Histograms with limits
            Ivan Johansson

            Thanks Yuri!


            I don't know when it was fixed but when I tried it again in the new version - IT WORKED!!


            Now, I'm stuck with the one remaining problem to adopt the bin sizes automatically. The bin sizes can be modified with parameter but I havent found a way to do it with code...


            Regards, Ivan

            • 3. Re: Histograms with limits
              Yuriy Fal

              Hi Ivan,


              Glad it helped.


              Regarding your 'remaining problem', the calculation could be written

              that would have the same values as the Tableau-generated Bin pill.

              INT( [Value] / [Parameters].[Bin Size] ) * [Parameters].[Bin Size]

              Bin Size is usually a Parameter, but it could be a (Row-Level) Calc as well.