4 Replies Latest reply on Oct 5, 2016 10:01 AM by Bryce Larsen

    Conditional labels on heatmap

    Bryce Larsen

      Hello everyone!

      Is there a way to choose which labels are displayed on a heatmap? For instance, I have a heatmap showing percentage of values from a given day/hour over the entire week:

      HeatmapPercentages.png

       

      For easy viewing we have made rounded to the nearest integer, so some round down to zero despite having values. Is there a way to only show labels for values greater than or equal to 3%? I want to really be able to have the users focus on these areas if possible.

       

      I have made a new custom field to try to do this, but when I drag to the marks label it colors the percentage I've just dragged and removes the box shading:

      HeatmapPercentages2.png

        • 1. Re: Conditional labels on heatmap
          David Li

          Hi Bryce! Can you share a packaged workbook with us? Or at least the formula in question?

           

          Off the top of my head, I think you'd want to put a calculated field like this on the Labels mark and then format zeroes to be blank:

          IIF(SUM([The Measure]) >= 0.03, SUM([The Measure]), 0)

          • 2. Re: Conditional labels on heatmap
            Bryce Larsen

            Hi David,

            The calculation to drive the initial heatmap (% of Weekly Boarders):

            SUM([Boarder Hour])/SUM([Total Weekly Boarder Hours])

            Custom label I created that lead to image 2 above:

            IIF([% of Weekly Boarders]<.03,null,[% of Weekly Boarders])

             

            My goal, if possible, would be to keep similar view as first image above but not display values displaying 0%-2%. I'd LIKE to be able to keep the boxes if they are not null.

             

            Like this (created outside of Tableau, showing >=3%):

            HeatmapPercentages3.png

            • 3. Re: Conditional labels on heatmap
              David Li

              Just to make sure, did you leave [% of Weekly Boarders] in the color mark? The custom label calculated field should go only in the labels mark. Can you take a screenshot of the whole Tableau application?

              1 of 1 people found this helpful
              • 4. Re: Conditional labels on heatmap
                Bryce Larsen

                David Li

                Ahhh. I had done that, but the sheet was set up with Marks as Automatic (went to Text). I've changed to "Square" and it's resolved!

                HeatmapPercentages4.png

                 

                Silly me. Appreciate the help. Clearly been too in the trenches building other aspects to think this through thoroughly!

                 

                HeatmapPercentages5.png