4 Replies Latest reply on Oct 21, 2016 12:18 PM by Brittney Parker

    Calculated Field for a Map

    Brittney Parker

      Hi All,

        I have been working in Tableau for a couple of weeks now and feel like I have the basics for calculated fields but am stumped at how to proceed on my current task.

       

      So I have two dimensions and one measure.

      Dimensions: State Name and Zip

      Measure: Held Revenue Amount

       

      What I am trying to do once I have the State Name and Held Revenue populated on the map is to have the zip codes associated with the state populate on the tooltip card. I thought making a calculated field would be the best option for this, but am clueless as to how to write the formula.

       

      I have attached a sample workbook of what I'm working with. Any help would be much appreciated!

       

      Regards,

      Brittney

        • 1. Re: Calculated Field for a Map
          Benjamin Greene

          I'm not sure of a way to get a list of all the zip codes in one state to show up in the tooltip, and I'm not sure that would even be practical (considering the hundreds of zip codes in states like California). The closest thing I could think of was to make a dashboard with the map and a list of zip codes and an action filter that will show only the relevant zip codes when you hover over a state. Let me know how you think this looks.

          • 2. Re: Calculated Field for a Map
            Brittney Parker

            This looks great! I haven't played around with Actions at all but it seems to get the same point across. Since this would be my first time using an Action, would you mind explaining the process so I can recreate? I appreciate all your help.

             

            Thanks,

            Brittney

            • 3. Re: Calculated Field for a Map
              Benjamin Greene

              Of course! Glad to help. Here's the step-by-step process I took:

               

              1. Create a new sheet and drag State Name and Zip Code to rows. Right-click the Zip Code pill and deselect Show Header.

              2. In the menu bar at the top, select Analysis>Table Layout and then deselect Show Field Labels for Rows.

              3. Drag another instance of Zip Code to Text.

               

              4. Create a new Dashboard and change the Size to Automatic. Drag Sheet 2 into the view.

              5. Click the empty space under the Held Revenue Amount color legend so that the blue container is selected, then right-click in the container and select Edit Width. Set the width to 200 pixels.

              6. Drag Sheet 3 into that container below the color legend. Right-click the Sheet 3 title and select Hide Title.

               

              7. In the menu bar at the top, select Dashboard>Actions. In the window that pops up, click Add Action>Filter.

              8. Make the Sheet 2 the Source and Sheet 3 the Target and make sure Run action on: is set to Hover, then click OK to close out the windows.

               

              Let me know if you run into any problems with this!

              • 4. Re: Calculated Field for a Map
                Brittney Parker

                Worked perfectly!

                 

                Thank you, Benjamin for all of your help! Much appreciated.

                 

                Thanks,

                Brittney