6 Replies Latest reply on Nov 21, 2018 12:01 PM by Jennifer VonHagel

    Gradient map not using full range of colors

    Kurt Heisler

      I'm trying to create a gradient map where the color for each county is based on the county's percent change in performance between two dates. I added as a filter the date field (QuarterStart) and selected the two dates of interest. I then added to the Color card the variable holding Performance, and set it as a Quick Table Calc (Percent Difference) with Compute Using = QuarterStart, Relative to = Previous.

       

      The counties on the map show the correct % changes, and the color legend shows the correct range (-87.5% to 64.8), but the map is not being color coded according to the full range (an orange-blue diverging). For example, shouldn't the -87.5% be in red (instead of tan), and the 64.8% be in blue (instead of gray)? In fact, there's no deep blues or reds at all despite several counties being near the ends of the range. Color opactiy is set to 80% (Tableau's default). I've tried editing the colors to use different color Palettes, Stepped Color options, Use Full Color Range, using different Start and End values, but the problem persists. Any ideas?

       

       

      Added a packaged workbook.

        • 1. Re: Gradient map not using full range of colors
          Jennifer VonHagel

          Hi Kurt,

           

          Have you tried checking the third option in the dialog box you have showing in your attached pic: "Use Full Color Range"?

           

          Best,

          Jennifer

          • 2. Re: Gradient map not using full range of colors
            Kurt Heisler

            Yes. I also checked Start, End, and / or Center.

            • 3. Re: Gradient map not using full range of colors
              Jennifer VonHagel

              What strange behavior. Can you attach your workbook with the problem? It's difficult to try to diagnose without poking around.

               

              best,

              Jennifer

              • 4. Re: Gradient map not using full range of colors
                Ken Flerlage

                Can you attach a workbook?

                • 6. Re: Gradient map not using full range of colors
                  Jennifer VonHagel

                  Hi Kurt,

                   

                  If you bring Quarterstart to the Columns Shelf, you'll get the desired result.

                   

                  You can then Hide the Previous Quarter by right-clicking the quarter value and choosing Hide:

                   

                  This isn't great for dynamically updating your workbook.  I have a client for whom I do a lot of YoY % Change by Quarter, mapped. There are a few ways to make this more dynamic and easily update-able.

                   

                  1. Create an explicit YoY % Change formula: ( SUM([Performance]) / LOOKUP(SUM([Performance]),-4) ) - 1

                   

                  It's more easy to see how this works in table format where all quarters are allowed in.  It compares the current column (quarter) performance to the performance found 4 columns before the current column. This is safe only if your data won't have missing quarters in between.  If your data may have quarters missing, there are a few other ways to do it.

                   

                  2. Set up your Map view with all Quarters showing in the columns.

                  3. Create a True/False calculation to determine which is the most recent quarter in your dataset. Put this on the columns shelf before the Quarterstart column.

                   

                  4. Right-click on the "False" value in the view and Hide it.

                   

                  Leaving only the map where Is Latest Quarter = True.  Now if you refresh your data with a new quarter, it will show here.

                   

                   

                  You may not automatically want the Latest Quarter, you may want to choose a quarter.  If so, you can put your quarters into a parameter:

                   

                  1. Create Parameter and populate with Quarters from your Date field:

                  2. Create a True/False field for whether Quarterstart = the Quarter chosen in the Parameter, and put it on the Columns Shelf before Quarterstart:

                   

                  Now, the TRUE quarter will be whichever is chosen, and the YoY % Change is still looking for 4 columns previous for its comparison point.  You can right-click and hide the False columns.

                  You can also right click and Hide the column headers: "Is Chosen Quarter / Quarterstart", "True", and "10/1/2017".

                   

                  Workbook is attached. I hope this helps.

                   

                  Best,

                  Jennifer