7 Replies Latest reply on May 18, 2018 3:06 PM by Jennifer VonHagel

    Allow User to Choose a Measure for Heatmap

    Albert Dorfman

      Hello,

       

      I'm working on creating a dashboard for a client, and the main page of the tableau file contains a map.

       

      Currently, every area on the map is shaded blue, but I want to turn it into a heatmap.

       

      I know how to turn this into a simple heatmap -- i simply drag a measure into the color panel and change the settings. However, I want to give the user the option to toggle between multiple versions of this heatmap based on different measures.

       

      Ideally, I would have a panel (as seen below) where the user can select a measure to decide what the heatmap is based on. In this example the user would be able to see multiple heatmaps based on he following:

      - Sales

      - # of SKUS avalable

      - Marketing Dollars

       

       

      Is something like this possible in tableau?

       

      Thanks,

        • 1. Re: Allow User to Choose a Measure for Heatmap
          Jim Dehner

          Good morning

          please see the attached

           

          create a parameter for the user input

           

          create a statement

           

           

          then create the viz

          Jim

           

          If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

          • 2. Re: Allow User to Choose a Measure for Heatmap
            Jennifer VonHagel

            ***Edited to attach workbook***

             

            Hi Albert, sure, set up a parameter having the descriptions of your measures. Here I'll use some measures from SuperStore.

            Then create a calculated field which will show the measure selected by the Parameter.

            Build your view, and Show your Parameter control:

             

            Workbook is attached.

             

            Best,

            Jennifer

            • 3. Re: Allow User to Choose a Measure for Heatmap
              Albert Dorfman

              Hi Jennifer,

               

              Thank's a lot, this really helps.

               

              What I want to do next is to setup a different center point for each one of these. So in your example,profit would have a center point of 0.2, sales would have a center point of $500 etc.

               

              Currently the center point is set as the halfway point between the min and the max, but I want to be able to manually set it for each metric that you have placed in the "heat map by"

               

              Is this possible to do?

               

              Thanks again,

               

              Albert

              • 4. Re: Allow User to Choose a Measure for Heatmap
                Jennifer VonHagel

                Hmm, I have often wished I could put a calculation in the color range beginning, end, and center points, but I haven't figured out how to do it.

                 

                In this case, if you only have three measures, I guess I would create three map worksheets - one for each measure. We'd put all three sheets in a container on a dashboard, and use the parameter to show the map selected and hide the two that are not selected.

                 

                So, set up a Sales map, and set the center point however. Notice here I have mapped SUM(Sales), not the parameter-driven calculated metric. Duplicate this as two more sheets and set up Profit and Profit Ratio.

                 

                 

                Now we'll create a filter for each measure's sheet to make it show if its parameter value is selected, or be blank if not. We do this by setting TRUE or FALSE. When this filter evaluates to FALSE the entire sheet will go blank (except the Title). So we'll put the following filter on the Sales Sheet. You can see that Profit Ratio is chosen in the parameter selector on the right, and the sheet is blank.

                Duplicate this calculated filter twice - one for Profit and one for Profit Ratio, and put the filters on the corresponding Profit and Profit Ratio worksheets.

                 

                In a new dashboard, drag a floating vertical container onto the screen. Drag your three maps into the vertical container.

                For the blank sheets - Profit and Profit Ratio - the Title of the worksheets is showing. So go into each of the three sheets and hide all the Titles. Just right-click and choose Hide Title.

                Let's create a Title Sheet. Open a new sheet, click into the Title and insert the Parameter value. No need to have any fields in this view at all. I usually set the Marks card to Polygon, and then format the worksheet so it doesn't show any lines.

                Now back on the dashboard, drag the Title sheet into the very top of the Vertical container holding your maps:

                And now we are left with the problem of the legends of the blank sheets remaining on the page. I think this can be handled with some elaborate showing and hiding of sheets floating on top of them, but I'd have to work through it to figure it out.  In the meantime, maybe someone else knows a more automatic or streamlined approach .

                 

                Hope this helps,

                Jennifer

                • 5. Re: Allow User to Choose a Measure for Heatmap
                  Jennifer VonHagel

                  Ok, I just spent way too much time figuring out how to dynamically show and hide the legends , but I'll probably want to use it some day.

                   

                  I won't show all the steps - not sure you needed this and it may be more involved than its worth, but the general idea is that I put the three legends in a floating horizontal container:

                   

                  Then I put another floating horizontal container on top of it which has three sections (one for each legend) which will show white or transparent based on the parameter selected. So none of the legends actually disappear, but the two not selected get covered with white:

                  Workbook is attached.

                   

                  best,

                  Jennifer

                  1 of 1 people found this helpful
                  • 6. Re: Allow User to Choose a Measure for Heatmap
                    Albert Dorfman

                    Hey Jennifer,

                     

                    Thanks a lot for posting this! Was wondering if you could save in a prior version of tableau. I have 10.5.1 and it won't let me open your workbook.

                     

                    Thanks again for all the help,

                     

                    Albert

                    • 7. Re: Allow User to Choose a Measure for Heatmap
                      Jennifer VonHagel

                      Ok, I used 2018.1's Export as Version functionality. Hope it works the same in 10.5 .

                       

                      Best,

                      Jennifer