Actions

There are three types of actions that you can create on dashboards to add context, relevance, and specificity for your users, namely Highlight, Filter, and URL.

The following list describes these three action types:

  • Highlight actions: These draw attention to marks related to selections in a visualization without filtering other data points on the visualization.
  • Filter actions: These show only the selections made in a source visualization. They can be set up in such a way that when the marks in the source sheet are deselected, the target visualization shows all the marks, shows the filtered marks, or excludes all the marks.
  • URL actions: These allow you to link to generic URLs or dynamically add selected field values into URLs to link Tableau Public dashboards to external resources. As an example, we'll show you how to insert a country's name into a URL to directly link to its page on the World Bank's website.

Highlight actions do not filter visualizations, they only draw attention. URL actions link to external websites. Therefore, they don't have implications in dashboard performance. Filter actions have the following benefits:

  • They are comparably faster than Quick Filters. Tableau Public does not need to scan the contents of a field before they can function.
  • They can filter across multiple data sources without setting up join conditions ahead of time, which will be explored later on in this chapter.
  • They allow users to select and view only the granular data that's important to them.

Actions have a disadvantage. For a novice author, maintaining actions can be time-consuming. The actions that we will use in the following exercises are designed to allow users to filter all the visualizations to show only the countries that interest them. Then, we'll add a URL action that links to the World Bank's web page for every individual country.

In the dashboard, we have a map that shows every country for which we have data. We have filters for time and other geographic dimensions. Therefore, we have an opportunity to do the following two things with the countries:

  • We can create a filter action that limits the selections in other worksheets to the countries that a user has selected
  • We can create a URL action that allows a user to see the World Bank's web page for each country

The first task involves creating the Filter action that runs when a user selects a country from the map by performing the following steps:

  1. On the dashboard, click on the Dashboard menu and then click on Actions.
  2. Click on Add Action, and then click on Filter.
  3. Name the action Filter on Country. It's important to name actions according to their functions so that when you are editing and testing them later, you know where to look first.

    The following attributes need to be selected:

    • The source of the action, that is, the visualization from which it originates
    • The action that triggers it
    • The target sheets
    • The fields on which you need to run an action
  4. For the source, select the CO2 Emissions per Capita sheet on the dashboard.
  5. Run the action on Select. Thus, when a user clicks on a field, its correlated marks in the target sheet will be highlighted. The alternatives are running the action when a user hovers over a mark or showing a hyperlink to run the action when a user rolls over Menu. We will use Menu for the URL action.
  6. Target all the sheets on the dashboard except for the CO2 Emissions per Capita sheet.
  7. Leave the default values to clear the selection. If we had worksheets that we wanted to hide until someone made a selection, which is a great option, we would have excluded all values.
  8. Next, we need to establish the fields on which we want the filter to run. When a user clicks on a country, the value for that country is used as a filter for other sheets.

    In case you left the setting on All Fields, then all the attributes of the mark will be passed as a filter, but only to fields of the same name. For example, if you were going through the values for region and country, then each sheet with those exact same field names and values would be filtered.

    Since we have a secondary Data source, specifically the Foreign Aid data, that does not have the same field name for each country (though the values are the same) and has completely different values for the Region field, we need to establish targets.

  9. Click on the Selected Fields radio button. Though using specific fields can potentially cause the dashboard to run more slowly with very large data sets, we need to establish the fields on which we need to join the Data sources.
  10. Click on Add Filter. Since the action is running from a sheet using the World Bank Climate Change data source, it is the default for the source. Pick the Country Name field. Then, for the target, select the same Data source and field. This tells Tableau Public that for sheets that use this Data source, use the Country Name field as both the source and target. Check out the result in the following screenshot:
    Actions
  11. Click on OK.
  12. Click on Add filter again. Select the Country Name field again as the source, but for the target, select the Foreign Aid Data sources and then select the Country field as the target.
  13. Click on OK.
  14. Check out the action dialog box, which is now complete, as shown in the following screenshot:
    Actions
  15. You can edit and remove the target filters as required.
  16. Click on OK.
  17. Back on the dashboard, modify the title above the map so that it says Click on a country to filter as sub-text in 12 pt Arial, as shown in the following screenshot:
    Actions
  18. Draw a box around an area of interest on the map. Check out the changes made to other visualizations in the dashboard, as shown in the following screenshot:
    Actions

Note

If we were to add additional visualizations to this dashboard, they automatically would become targets of the actions that we have established. For this reason, it's wise to wait until you have added everything of interest to the dashboard before creating actions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset