The Power of Tableau Actions

How to create highly interactive Tableau dashboards using actions: a step-by-step tutorial and an example workbook

Action - Tableau ClapperboardEven if you are creating the most basic chart with Tableau Software, the visualization already includes a great set of interactive features without the need for using special functionality: clicking on a data point highlights this point and shades off all others. Clicking on an entry in a color legend highlights all data points belonging to this category. Hovering over data points displays tooltips with all used underlying data, and so forth.

However, Tableau offers even more than that: Tableau actions. Basically, actions are Tableau’s way of sending user interactions across the workbook. The user selects a data point of one visualization and actions give you full control of what is supposed to happen on the other visualizations and worksheets.

Today’s post includes a detailed how-to tutorial on the power of Tableau actions:

  • what are actions and what can you do with them,
  • what types of actions are possible and
  • a step-by-step tutorial on how to use actions on a dashboard

The tutorial is based on example data of the 50 most prominent summits on earth and provides a Tableau Public visualization of the final result.

The Source Data

During this summer we had two articles on Tableau dashboards visualizing FIFA World Cup statistics here and here. I am always looking for data and examples to be used in the workbooks provided with my posts. I like the idea of using sports related data, because there are tons of sports data publicly available and sport is something a lot of people are interested in.

However, this time I will not use football statistics again. I recently discovered a somehow strange, yet interesting quote:

“There are only three sports: bullfighting, motor racing, and mountaineering. All the rest are merely games.”

The origin of this quote is unclear. Very often it is attributed to Ernest Hemmingway, other people affirm it was the American writer and author Barnaby Conrad who said this.

To be honest, I don’t like bullfighting and for me there is no thrill in watching people driving around in circles. Though, I do love mountaineering. Having said this, we will use the list of the 50 most prominent mountains on earth (see definition of prominence here). The data includes the summits, the continents, the countries, the elevation, the prominence, the first climbers, the year of the first ascent, the latitude and longitude and a link to the Google Map view. The core piece of the data is taken from peaklist.org, enhanced with different information from different sources (if available at all).

The Challenge

First of all we want to create a Tableau workbook and dashboard that visualizes all information included in the data source. The dashboard could look like this:

50 most prominent summits on earth - click to enlargeOn top of that, we want to add further interactivity:

  • Clicking on a continent in the top left bar chart zooms the map to this continent and highlights the summits on this continent in the data table
  • Clicking on a summit on the map highlights the mountain on the map and the according row of the data table and navigates the Google Map view to this summit 
  • Clicking on a row or bar in the data table highlights the mountain on the map and data table and again shows the Google Map view of the selected summit in the web browser window 

These requirements are a great use case for Tableau actions. The preparatory work however is creating a Tableau workbook, the visualizations and the dashboard itself:

How to set up the Tableau Worksheets and the Dashboard

First step is opening a new Tableau workbook, connecting to the data and creating the following 3 worksheets:

  1. On the worksheet Summits per Continent, we drag the dimension [Continent] to the row shelf, the dimension [Summit Name] to the column shelf, change the measure of [Summit Name] to CNT and sort the continents descending. With only 4 mouse clicks, we created a bar chart visualizing the number of summits per continent.
  2. On a worksheet called Map, we drag [Latitude] to the row shelf, [Longitude] to the column shelf and SUM(Elevation) to the size shelf. The result: a visualization of the 50 TOP summits on a World map.
  3. Finally, on the worksheet Summits, we use [Summit Name], [Country], [First Ascent By] and [Year] on the row shelf, SUM(Elevation) and SUM(Prominence) on the column shelf and sort descending by prominence. That’s it: a data table including two bar charts. 

 
Insert Web Page Object - click to enlargeIn the next step we insert a dashboard, select all 3 worksheets created in the previous step by double-clicking in the dashboard window and add a web browser element by clicking on “Web page” in the objects part of the dashboard window (see left). For the time being, we leave the URL empty. We will use this web page later to display the Google Map view of the selected summit.  

Finally we arrange the elements on the dashboard by dragging and dropping and – if desired – change some colors and formats. Again, only a couple of mouse clicks are necessary to create a nice dashboard. However, the interactivity between the different dashboard elements is still missing.

This is where Tableau actions come into play:

How to use Actions on Tableau Dashboards

What are Actions?

Actions are the functionality that brings full flexible interactivity to your Tableau worksheets and dashboards. In a nutshell, actions send information across different worksheets and visualizations. If the user of your Tableau workbook clicks on a data point on any given worksheet or dashboard visualization, actions give you full control over what should happen on all other worksheets and visualizations.

Tableau provides 3 different types of actions:

  • Filter Actions
  • Highlight Actions
  • URL Actions

For our example, we will use all three types to enrich our dashboard with the required interactive features.

Highlight Actions

The first action is highlighting a summit on the map and on the data table if the user either clicks on a data point on the map or a row in the data table.

The step-by-step:

  • select Edit|Actions from the main menu,
  • select “Highlight” from the actions dialog: 

Actions Dialog - click to enlargeThe following window appears:

Highlight Action 1 - click to enlarge

  • give the action a name
  • click on “Run action on Select”,
  • select Map and Summits as the source sheets,
  • select Map and Summits as the target sheet

That’s it.

The second highlight action will highlight all summits of a selected continent on the data table, as soon as the user clicks on a bar in the Summits per Continent bar chart. The step-by-step is along the lines of the highlight action described above. The according Edit Highlight Action window looks like this:

Highlight Action 2 - click to enlarge

That’s it. A couple of mouse clicks and you have great interactive highlighting across different visualizations of your dashboard.

Filter Actions

The filter action provides the following interactivity: if you click on a bar of the “Summits per Continent” visualization, the Map will zoom onto the selected continent. It would be easily possible to apply a filter on the “Summits” data table as well. However, we don’t want to filter the data table, since we already implemented another action to highlight the summits of the selected continent (see previous section).

Here is the step-by-step for adding the filter action:

  • click on Edit|Actions,
  • select “Filter action” from the actions dialog,
  • assign a name to the action
  • click on “Run action on Select”,
  • select Summits per Continent as the source sheet,
  • select Map as the target sheet,
  • choose “Selected Fields” in the Target Filters section
  • click on “Add Filter” and select the [Continent] as source and target field

This is how the according Edit Filter Action dialog looks like:

Filter Action - click to enlargeURL Actions

The final action is used to update the web page object with the Google Map view of a summit that is either selected on the map or on the data table.

In the first step we have to add the dimension [Aerial link] to the level of detail shelf on the worksheets Map and Summits, since this dimension is not yet used used there. Then we go back to the dashboard and

  • click on Edit|Actions,
  • select “URL action” from the actions dialog,
  • assign a name to the action
  • click on “Run action on Select”,
  • select Map and Summits as the source sheets,
  • click on the arrow right to the URL line and
  • select the dimension [Aerial link]

The Edit URL Action dialog should look like this:

URL Action - click to enlargeThat’s it. Every time you click on a data point on the map or within the data table, the web browser object on the dashboard will show the according Google Map view.

Two Remarks on the URLs in the Source Data

  1. The URLs of the Google Map view are included in the source data. For an optimal visualization of the view, you have to make sure, that the URLs include the string “&output=embed”. Otherwise the Google Maps logo, the Google menus, etc. will take a considerable part of the real estate of the web object.
  2. Since we have the latitude and longitude in our data as well, we do not necessarily need the dimension [Aerial link] in the source data. We could use a calculated field as well. The formula would look like:

    “http://maps.google.com/maps?ll=”+
    STR(FLOAT([Latitude]))+
    “,”+
    STR(FLOAT([Longitude]))+
    “&spn=.3,.3&t=k&hl=en&output=embed”

    This calculated field creates the Google Map URLs from the latitude and longitude automatically. Though, there is one drawback you should be aware of: the URLs in the source data include optimized lat/long span for each summit. The calculated field, however, uses a hardcoded span of 0.3 / 0.3 (or whatever you choose). Thus, you will see the summit in the web object on the dashboard, but the zoom factor may not be optimal in every case.

The Dashboard on Tableau Public

 

Due to the limited space on my blog, the visualizations are one below the other and I took out the columns [First Ascent by] and [Year] from the data table. However, if you have Tableau Desktop available, you can download the workbook and it should be a piece of cake to turn the dashboard into the visualization shown in the section “The Challenge” of this post. 

Acknowledgments

Many thanks go to Giedre Aleknonyte and Joe Mako, who were kind enough to review my Tableau workbook prior to publishing and – as usual – gave extremely valuable inputs for improvement.

If you don’t know Giedre: have a look here or here. If you are taking part in this year’s Tableau Customer Conference, I highly recommend to visit her presentation there.

If you don’t know Joe, you probably never visited the Tableau Software Forums. Joe is one of the most active members there, with an impressive number of almost 1,000 posts so far. If Tableau will ever put something in place like a Most Valuable Tableau Professional, I’ll bet you, Joe will be one of the first experts to be nominated.

Tableau how-to tutorials on Clearly and Simply – your opinion?

Today’s post is somehow a new type of article here on Clearly and Simply. It is the first to provide a detailed how-to tutorial on a standard functionality of Tableau Software.

Previous articles described workarounds for missing functionality (like Choropleth Maps with Tableau or Animate cumulative data with Tableau), provided some visualization examples (like FIFA World Cup Statistics with Tableau or Tableau Replica of Curtis Steiner’s 1,000 Blocks) or discussed special effects (like Week in, week out, Tableau).

What do you think? Do you want to see more Tableau how-to tutorials? Or do you think this type of articles are redundant because everything is already described in the Tableau Manuals, the Tableau Online Help and the Tableau Training Videos?

If you have a minute, please leave me a comment and let me know what you would prefer.

What’s next?

In November last year, Matt Grams contributed a beautiful guest article on how to bluff a Tableau lookalike visual cross-tab chart with Microsoft Excel:

Bluffing a Visual Cross-tab with Excel

Trying to emulate Tableau visualizations and functionality with Microsoft Excel is an interesting and informative approach: it not only improves the quality and functionality of your Excel workbooks and models, but also forces you to explore Excel’s enormous flexibility and helps to improve your Excel skills.

Having said this, the next post will describe a way to bluff some of the Tableau action functionality described in this post with Microsoft Excel. As always including the Excel workbook for free download.

Stay tuned.

Comments

33 responses to “The Power of Tableau Actions”

  1. Marco Fulvio Avatar
    Marco Fulvio

    Well done bud… and definitely more tableau tutorials! Great software

  2. Dan Murray Avatar

    Nice demonstration of the value of URL Actions. People seem intimidated by Tableau Actions but they are really not difficult to master. Well done.

  3. Robert Avatar

    Marco,
    many thanks and welcome to commenting here!
    Dan,
    I know that you don’t need how-to tutorials anymore, but what do you think: more step-by-step tutorials here or are they needless because of the tons of material Tableau provides?

  4. Acotgreave Avatar

    Great post – nice to see you trying to demystify Actions. I think they’re extremely powerful, and easy to implement. The biggest difficulty is maintenance, if your workbook grows and evolves overtime. Trying to unpick Actions and redesign the way they work can be quite a challenge!

  5. Robert Avatar

    Andy,
    many thanks for your comment and appreciation.
    I fully agree with your statement regarding the efforts needed to maintain actions in large workbooks that change and evolve over time. However, on the strength of my past experiences, users very often shrink back from using actions for whatever reason. In my humble opinion actions are a great but yet undiscovered or highly underestimated feature of Tableau.

  6. Joe Mako Avatar
    Joe Mako

    Robert,
    Thank you for the very kind acknowledgement. The real number of posts that I have made on the forum is less than 500, not almost 1,000. (Yes, I have scrapped and analyzed the Tableau Forum)
    The content you provide here is not redundant. Browsing through the forums, you can tell that these kinds of tutorials are needed, because the documentation and training provided by Tableau cannot cover every possible topic. There are many tricks, and combinations of tricks that you can use in Tableau to get the results you want that are not covered in Tableau training. I try to help document some on the forum, but there are many more to cover.

  7. Robert Avatar

    Joe,
    many thanks for your comment. The acknowledgement was no flattering. I truly admire your deep knowledge of Tableau. Thank you for all your contributions to the Tableau community. I already learned a lot from your posts.
    I did not scrap and analyze the forum to get the number of your posts. I simply looked at your latest entry and this one says: “joemako 982 posts”. Howsoever, even 500 are a more than an impressive number.
    Finally thanks for the encouragement to write further how-to tutorials.

  8. Joe Mako Avatar
    Joe Mako

    Andy,
    One way to mitigate the complexity of maintaining actions is good naming of worksheets and actions. Robert provided some good examples of descriptive action naming, e.g., “Highlight Summit by Click on Continent Bar”.

  9. Chandoo Avatar

    Robert, Very interesting read.
    I have just started playing with Tableau Public. I have been watching training videos on tableau’s website and using sample datasets to understand various features.
    But tutorials like these are really best (and fastest) way to learn. I am going to re-do this before this weekend.
    Thank you once again and please write more tutorials like these. 🙂

  10. Robert Avatar

    Chandoo,
    thanks for your kind words and the encouragement. As already mentioned at the end of the post, the next article will show some techniques how to emulate Tableau actions in a Microsoft Excel workbook. I think you will be interested in this one also. Stay tuned.

  11. Kelly Avatar
    Kelly

    Robert –
    I really like this tutorial.
    The tutorials on the website are very good good – but with your tutorial above, you blended details from many different topics into one very practical and useful example.
    Yes! Many more like this please.

  12. Hock Gan Avatar
    Hock Gan

    Great visualisation – I particularly liked the link to Google Maps. I tried using your formula in my own workbook to replicate the action but Tableau returned an “unterminatated string” error to the formula (This is in relation to the ” at the end of the formula). I can’t figure out why and would wondered if you can shed some light on this.

  13. Robert Avatar

    Hock Gan,
    many thanks for your comment.
    Are you sure you are having a quotation mark after the last + sign?
    I suspect you are having
    +&spn=.3,.3&t=k&hl=en&output=embed”
    instead of
    +”&spn=.3,.3&t=k&hl=en&output=embed”
    at the end of the calculated field.

  14. Hock Gan Avatar
    Hock Gan

    Hi Robert,
    There is a quotation mark at the end of the last + sign as I copied and paste your formula directly into Tableau. This is what appears in the formula pane:
    “http://maps.google.com/maps?ll=+
    STR(FLOAT([Latitude]))+
    “,”+
    STR(FLOAT([Longitude]))+
    “&spn=.3,.3&t=k&hl=en&output=embed”

  15. Robert Avatar

    Hock Gan,
    my bad. I had a missing quotation mark in my article. However, it was not the one after the last + sign. There was one missing after the first = sign. I updated the post now.
    I apologize for the confusion.

  16. Hock Gan Avatar
    Hock Gan

    Thank You.
    It worked beautifully.

  17. Kelly Avatar
    Kelly

    Robert,
    Thank you again for this tutorial.
    I used it today with great success – I needed to use both the filter and highlight actions – and your explanation was perfect.
    Kelly

  18. Dan Avatar
    Dan

    Robert,
    I realize that this is an old post but it is exactly what I am looking to do. I can’t seem to find the correct source data. Did the original post contain the data and I am just too far behind or did peaklist.org change format?
    -Dan
    By the way nice tutorial.

  19. Dan Avatar
    Dan

    Doh!.. Nevermind….

  20. Cathy Bridges Avatar
    Cathy Bridges

    Have you been able to test this workbook in Tableau 8? The google map doesn’t seem to be updating for me, and I’m not sure if it has to do with the upgrade or if it’s something I’m missing.
    Thanks!

  21. Robert Avatar

    Cathy,
    thanks for your comment and sorry for the late reply.
    I just tested and it works like a charm with Tableau 8 for me. I have no idea why it shouldn’t work for you.

  22. kushal Avatar
    kushal

    Robert,
    Amazing article and the best use of actions.Kudos!!!
    I replicated the same workbook and with same actions applied across dashboard.Whenever I hover around the map it shows the correct url(tooltip) to link but when selected it does not show the summit images as per this workbook rather shows default URL everytime.Since there are hidden tips and tricks involved in tableau.Can you highlight why this thing is not happening?.
    Thanks in advance.

  23. Robert Avatar

    kushal,
    I just double checked the original workbook with Tableau 8 and it is still working fine for me. If the URL action does not update the correct Google Map view in your workbook, I would suspect there is a problem with the URL provided in your data source or with the Calculated Field you may be using to create the URL. I can’t tell you why, though. If you want to, you could send me your packaged workbook by email and I will have a look (email-link at the top of the blog).

  24. ML Avatar
    ML

    Great tutorial. I would like to see more like this. These are great, in addition to the Tableau videos, because they offer more depth and further examples. Please continue.

  25. Kali Avatar
    Kali

    Where can i download the summit worksheet for this tutorial

  26. Robert Avatar

    Kali,
    there is a download link at the bottom right of the Tableau Public visualization.

  27. João Farinha Avatar
    João Farinha

    Hey nice tutorial, very well explained.
    Pardon my lack of intelligence but i didn’t understand how i could acquire the data source. I downloaded the excel but there isn’t a continent column. Can you point out where the data source is located?
    Thanks.

  28. Robert Avatar

    João,
    actually, the Excel workbook emulating the Tableau functionality provided in the following article does not contain the continents, because the continents were not needed for the Excel visualization. The data source used in the Tableau implementation above, however, includes the continents. If you need this data, you can download the packaged Tableau workbook and extract it or you open Tableau, view the data and copy it from there.

  29. JS Avatar
    JS

    This is very helpful! Keep on posting!

  30. s Avatar
    s

    I have a doubt in url action, if we have deleted the dashboard or workbook with url links in it, then what happens to those links?? will they get deleted with the dashboard or not

  31. Robert Avatar

    s,
    in general, there are two main sources for a URL-link in Tableau: you either have a dimension with the according links in your data source or you have a Calculated Field which creates the URL-links from other dimensions and measures. In both cases, deleting a dashboard or worksheet with an URL-action will not delete the links. Tableau never deletes source data or Calculated Fields when deleting worksheets, dashboards or storyboards. Having said that, if you want to use the same URL-action on another dashboard or worksheet, you have to insert the it again.

  32. Ashish Avatar
    Ashish

    Hello Robert,
    Thanks for the article! I would request your expertise on one case where multiple action filters coming from different sheets but targeting one single worksheet should be applied with OR logic between them and not as AND or replace the earlier action filter.
    Thanks,
    Ashish

  33. Robert Avatar

    Ashish,
    I am sorry, but I do not know of a way to set up action filters with an OR condition. This doesn’t mean it impossible, but it is above my head. Maybe you want to post your question in the Tableau forums? If you don’t get an answer there, it probably isn’t possible…

Leave a Reply

Your email address will not be published. Required fields are marked *