13 Replies Latest reply on Feb 27, 2013 1:38 PM by Thomas Exter

    Map Highlights & Table Calcs

    Shawn Wallwork

      Jonathan & Richard,

       

      I was playing with maps, highlight actions and table calculations (sort of working on this thread: http://community.tableau.com/thread/123113). What I came up with doesn't really have much to do with his question, so I'm starting a new thread. I have a hover action set up on a dashboard that is driven by a LOOKUP() table calculation. When you hove over a state, a bunch of other states get highlighted. This could be a useful technique, the problem is I can't figure out how to control it (or even what it's doing). Got any ideas?

       

      --Shawn

        • 1. Re: Map Highlights & Table Calcs
          Richard Leeke

          Weird. I'll have a better look later and see if I can figure out what is happening. The most likely use I can see at first glance is to make up for the lack of a random number generator in Tableau!

          1 of 1 people found this helpful
          • 2. Re: Map Highlights & Table Calcs
            Shawn Wallwork

            Please stop making me laugh dude! My broken ribs still aren't healed.

             

            --Shawn

            • 3. Re: Map Highlights & Table Calcs
              Jonathan Drummey

              Hi Shawn,

               

              Thanks for posting a packaged workbook, I can see what is going on, but I don't know your desired results are. Could you post a mock-up of what you're looking for?

               

              The Calculation5 formula LOOKUP(ATTR([Region]),1) and the Compute Using is an Advanced on State, Region. So what's happening is the table calc is returning the next row's Region to the current row, so for example Texas in the Central Region return's Utah's West Region for Calculation 5. Then the highlight table is acting on every state that also returns West for Calculation5. I set up a crosstab to show what's happening.

               

              Situations like this are why I first build table calcs in text tables, they make it pretty easy to see when a table calculation is returning the desired results.

               

              FYI, I learned last week that Highlight Actions on table calcs will work across worksheets in a dashboard, but not Filter Actions.

               

              Jonathan

              1 of 1 people found this helpful
              • 4. Re: Map Highlights & Table Calcs
                Shawn Wallwork

                Jonathan, I haven't opened your workbook yet, but I do have a mock-up (use-case) for you:

                 

                Jonathan Mock Up.png

                 

                These are the primary trading partners for Maine Lobster based on sales volume.

                 

                [I'll trade you some Hatch green chili for some lobster!]

                 

                --Shawn

                1 of 1 people found this helpful
                • 5. Re: Map Highlights & Table Calcs
                  Jonathan Drummey

                  I looked at that original thread and I'm not sure what his data looks like, and I'm not sure how you're getting to choose the product (like Maine Lobster) here. One hint is that for the highlight to work there needs to be a value that is the same for all rows to be highlighted.

                   

                  Jonathan

                   

                  PS: What's a Hatch green chili?

                  • 6. Re: Map Highlights & Table Calcs
                    Shawn Wallwork

                    Jonathan, you asked for a "mock-up" so that pix is just that, not a working viz.

                     

                    My point was that when I was playing around trying different combinations of stuff (sort of like playing darts in the dark while being blind-folded) I hit on the workbook I posted. Which had absolutely nothing to do with answering his question (hence the new thread). But having seen this inadvertent behavior from Tableau's highlight feature, I thought wouldn't it be great if we could hover over a state and see where that state, say sells their primary export; or when people move out of that bury-the-car-snow-storm state, where do they migrate to?

                     

                    So if you're looking for an interesting project for the long weekend, here's an option: Hover over any state, and highlight the top 10 states migrate to? Or if it's a net plus state, where do they immigrate from? If you're interested, I'll try to find (or at least mock-up) the data.

                     

                    --Shawn

                     

                    PS: Hatch, NM produces the best (tastiest) green chili in the entire universe, bar none!

                    1 of 1 people found this helpful
                    • 7. Re: Map Highlights & Table Calcs
                      Jonathan Drummey

                      Jonathan, you asked for a "mock-up" so that pix is just that, not a working viz.

                      I was teasing about the mockup.

                       

                      See the "filter action on hover" and "highlight action" in the attached...it's the beginnings of something. I set up a fictitious set of Maine lobster & Hatch green chili exports. In this case (and in the immigration cases you describe) there can be multiple rows per state as it is the destination for multiple products. I set up the data so  the view to draw each destination state, and had to include extra rows so that each source (ME and NM) state was it's own destination, that way there were source states to be used as the "origin" of an action.

                       

                      In both dashboards, when you hover over ME or NM the destination states are highlighted, the key difference being that with the highlight action the other states in the data are greyed out while in the filter action they are totally filtered out. Another difference is that with the filter action, there are no tooltips in v7. However, they are there in v8. I'll be asking support about that one.

                       

                      Either way, one factor is that all the destination states are in the view, if you hover over one of them then the action is triggered for whatever state/product is first in the sort order. (for example, if you swap the Product and Source State (copy) fields, you will change what gets reported when you hover over NY or TX). For this reason, if I were using this I'd try to set up a data set that had a row for every source state, even if there wasn't a row for every source/destination.

                       

                      Also, when the view is first drawn it's drawing for every combination of destination and source, which means there are 13 marks in this demo. That's not too bad, but then I started playing with some US Census immigration data, and in that the initial view is 2601 marks (every combination of US State & DC), which takes a relatively long time to draw. I'm pretty sure something could be done with table calc filters to reduce the number of marks displayed in the initial view. I'd also do something with the tooltips so the starting view that is showing lots of marks would only show totals, then when the view was reduced only show the desired #s. These table calc ideas would only work with a filter action, highlight actions don't cause table calcs to recompute.

                       

                      However, an issue that exists in both v7 and v8 is that if you set up a dashboard using the filter action on hover and put a 2nd worksheet in the dashboard (for example, including a crosstab so you can see the underlying data to get your table calculations to work), the map stops filtering on hover, though the 2nd worksheet is filtered. I'll be asking support about this as well. This latter behavior drove me batty for awhile and got me confused about what I was doing with census data, I'm leaving it in there for you if you're interested. For less confusion, I'd suggest starting with just the data and ignoring the views in the workbook. The data came from here:

                      http://www.irs.gov/uac/SOI-Tax-Stats-State-to-State-Migration-Database-Files

                       

                      I hope this is helpful to you, it's been a learning experience for me! I'll also post what I hear from support.

                       

                      Jonathan

                      • 8. Re: Map Highlights & Table Calcs
                        Shawn Wallwork

                        Jonathan interesting work. I'm still playing around with it, but I did discover that on the "filter action fails" tab if you go to the map sheet and create a worksheet action (instead of a dashboard action) you can get the map to filter as you would expect. It takes an extra second for the filtering to show, but it works. I guess the dashboard filter executes first, then the worksheet filter.

                         

                        --Shawn

                        • 9. Re: Map Highlights & Table Calcs
                          Jonathan Drummey

                          Hi Shawn,

                           

                          I can create a filter in the worksheet and have that work in the worksheet, however I don't see that worksheet filter or dashboard filter functioning on the "filter action fails" dashboard. Can you post the workbook where you got that to work?

                           

                          Jonathan

                          • 11. Re: Map Highlights & Table Calcs
                            Jonathan Drummey

                            Very cool find, Shawn! I did some more testing on this and the extra Filter Action on Hover will not work if the Source Sheet is set to the original worksheet. It will work if the Source Sheet is set to the dashboard & worksheet, or set to the data source itself.

                             

                            Here's what I heard from Tableau support today:

                             

                            - The issue with tooltips on v7 won't be fixed in v7, and it's working in v8 so that's all for that one.

                            - The behavior with the Filter Action on a worksheet no longer working when a 2nd worksheet is added, the design does exactly that. The workaround is what Shawn found and I expanded on - add a 2nd Filter Action on Hover.

                             

                            Jonathan

                            • 12. Re: Map Highlights & Table Calcs
                              Shawn Wallwork

                              Oooo! Getting a "very cool" from a Zen Master is a lot of fun. Thanks Jonathan! [Hey Catherine now I know what you mean. And where have you been by the way? ]

                               

                              --Shawn

                              • 13. Re: Map Highlights & Table Calcs
                                Thomas Exter

                                Hi, so I took Shawn's idea of state-to-state migration and sprinkled some "demographic dust" on it (hey, I'm a demographer) and came up the attached. I'm relatively new to Tableau but got to the point of filtering on the PATH_ID as in "contains" the following: *Washington filters for moves into Washington state (see dashboard) and Washington* filters for moves out of Washington. Path width is number of "filers" (e.g. households) and color is "follow the money" (e.g. AGI summed for all movers). See the greener folks (e.g. from CA) and their money moving into WA. Of course it's an aggregate to it's filers times AGI. (The average is available among the variables.)

                                 

                                I would appreciate suggestions on how to simplify or make more intuitive the filter selection perhaps without using the asterisk.

                                 

                                Thanks much.