Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; WP_MatchesMapRegex has a deprecated constructor in /home/stevensa/public_html/wp-includes/class-wp.php on line 635

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Translation_Entry has a deprecated constructor in /home/stevensa/public_html/wp-includes/pomo/entry.php on line 14

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; POMO_Reader has a deprecated constructor in /home/stevensa/public_html/wp-includes/pomo/streams.php on line 12

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; POMO_FileReader has a deprecated constructor in /home/stevensa/public_html/wp-includes/pomo/streams.php on line 106

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; POMO_StringReader has a deprecated constructor in /home/stevensa/public_html/wp-includes/pomo/streams.php on line 150

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; POMO_CachedFileReader has a deprecated constructor in /home/stevensa/public_html/wp-includes/pomo/streams.php on line 189

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; POMO_CachedIntFileReader has a deprecated constructor in /home/stevensa/public_html/wp-includes/pomo/streams.php on line 204

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; WP_Widget_Factory has a deprecated constructor in /home/stevensa/public_html/wp-includes/widgets.php on line 405

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Jetpack has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/jetpack/class.jetpack.php on line 25

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Jetpack_User_Agent_Info has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/jetpack/class.jetpack-user-agent.php on line 61

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/shortcodes.php on line 79

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/shortcodes.php on line 109

Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/shortcodes/soundcloud.php on line 131

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; safecss has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/custom-css/custom-css.php on line 1448

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Jetpack_RSS_Links_Widget has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/widgets/rsslinks-widget.php on line 9

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Jetpack_Image_Widget has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/widgets/image-widget.php on line 9

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Jetpack_Notifications has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/notes.php on line 25

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Jetpack_Subscriptions has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/subscriptions.php on line 39

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Jetpack_Subscriptions_Widget has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/subscriptions.php on line 519

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/load.php on line 545

Warning: Unterminated comment starting line 10 in /home/stevensa/public_html/wp-content/themes/themuse-child/functions.php on line 10

Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/stevensa/public_html/wp-content/themes/themuse-parent/framework/BootsTrap.php on line 6

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-content/themes/themuse-parent/framework/core/REQUEST.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Nav_Menu_Widget has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Nav_Menu_Widget.php on line 2

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Widget_Archives has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Archives.php on line 2

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Widget_Calendar has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Calendar.php on line 2

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Widget_Categories has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Categories.php on line 2

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_flickr has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Flickr.php on line 5

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Login has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Login.php on line 4

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Widget_Meta has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Meta.php on line 2

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_newsletter has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Newsletter.php on line 5

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Widget_Pages has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Pages.php on line 2

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Widget_Recent_Comments has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Recent_Comments.php on line 2

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Recent_Posts has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Recent_Posts.php on line 4

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Widget_Search has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Search.php on line 5

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Widget_Tag_Cloud has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Tag_Cloud.php on line 2

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Widget_Text has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Text.php on line 2

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TFuse_Widget_Twitter has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/widgets/TFuse_Widget_Twitter.php on line 2

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-content/themes/themuse-parent/framework/helpers/GENERAL.php on line 405

Deprecated: Function create_function() is deprecated in /home/stevensa/public_html/wp-content/themes/themuse-parent/framework/core/INIT.php on line 84

Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/stevensa/public_html/wp-content/themes/themuse-parent/framework/extensions/reservationform/config/utils.php on line 4

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TF_SEO_SitemapGeneratorXmlEntry has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/framework/extensions/seo/helpers/SEO.php on line 4

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TF_SEO_SitemapGeneratorPage has a deprecated constructor in /home/stevensa/public_html/wp-content/themes/themuse-parent/framework/extensions/seo/helpers/SEO.php on line 21

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; S2_Form_widget has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/subscribe2/include/widget.php on line 2

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Sharing_Service_Total has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/sharedaddy/sharing-service.php on line 352

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Sharing_Post_Total has a deprecated constructor in /home/stevensa/public_html/wp-content/plugins/jetpack/modules/sharedaddy/sharing-service.php on line 374
Tableau tutorial #2: Hierarchy, Calculated Fields | Creative Technology
Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Warning: count(): Parameter must be an array or an object that implements Countable in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/theme_includes/THEME_FUNCTIONS.php on line 1681

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 1697

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 1697

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 1697

Notice: Array to string conversion in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Array to string conversion in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Indirect modification of overloaded property WP_Post::$Array has no effect in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Warning: Illegal string offset 'output_key' in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Array to string conversion in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Array to string conversion in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Indirect modification of overloaded property WP_Post::$Array has no effect in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Warning: Illegal string offset 'output_key' in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Array to string conversion in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Array to string conversion in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Indirect modification of overloaded property WP_Post::$Array has no effect in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Warning: Illegal string offset 'output_key' in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Array to string conversion in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Array to string conversion in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Indirect modification of overloaded property WP_Post::$Array has no effect in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Warning: Illegal string offset 'output_key' in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Array to string conversion in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Array to string conversion in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Notice: Indirect modification of overloaded property WP_Post::$Array has no effect in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Warning: Illegal string offset 'output_key' in /home/stevensa/public_html/wp-includes/nav-menu.php on line 601

Warning: count(): Parameter must be an array or an object that implements Countable in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/theme_includes/THEME_FUNCTIONS.php on line 1681

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Warning: count(): Parameter must be an array or an object that implements Countable in /home/stevensa/public_html/wp-content/themes/themuse-parent/theme_config/theme_includes/THEME_FUNCTIONS.php on line 1681

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 1697

Tableau tutorial #2: Hierarchy, Calculated Fields

An adventurer has brought to life the floating home from Pixar movie Up

For many Tableau beginners, making high density, interactive visualizations can be a challenge.

Tableau woes – Part 1 addressed this challenge with three strategies for combining data variables into a single display rather than plotting them in individual rows and columns (Tableau’s default mode, that makes direct comparison difficult to impossible):

  • Measure Values
  • Blending Axes
  • Dual Axes

This post will explain two more tools that can be used to add data density to a Tableau viz and give it a bit more interactivity.

  • Create Calculated Field
  • Hierarchy

As with the previous post, I’m using Tableau’s superstore sales dataset.

Where we left off in the previous post

Where we left off in the previous post


Create Calculated Field
Starting where we left off in Tableau Woes – Part 1, what if you had created the viz above, but wanted to compare sales in one province, say Quebec, to national sales. If you tried to filter by province, Tableau would apply the filter all the Dimensions and Measures in the display and the end result would be a comparison of Quebec sales to Quebec sales, which is not useful.

The solution is to use Create Calculated Field. CCF is one of Tableau’s real strengths. It allows the user to create new Measures and Dimensions that were not in the original dataset, directly from inside Tableau and on the fly. With it, you can avoid having to back out of Tableau, revise the original Excel file, re-connect to Tableau and start all over again. Here’s an example:

  1. Again, starting where we left off in the previous blog post, go to the Analysis pull down menu and select Create Calculated Field.
  2. TableauWoes2-2

  3. In the Calculated Field dialog box, give the CF a Name at the top, such as Quebec Sales.
  4. Construct a Formula in the box below. In this case, we need a classic If This Then That logic function to be applied to each row in the dataset that goes like this: if the province is Quebec, then use the Sales value, else use a value of zero. In Tableau syntax, this looks like so:
    • IIF ( [Province] = ‘Quebec’, [Sales], 0)
  5. You could simply type the function into the Formula box, but it is better practice to double click on the actual Dimension, Measure and Function names in the lists below and let Tableau add the necessary brackets and get the exact spelling.
  6. TableauWoes2-3

  7. After closing the CCF dialog, a new measure called Quebec Sales will appear in the Measures list, from where it can be used to build a visualization like any other Measure or Dimension. You can tell it is a CF because of the little asterisk added to the symbol to the left of the Dimension name.
  8. Remove Profits from the Rows shelf and move Quebec Sales there instead. Then right click on Quebec Sales and select Dual Axis. Finally, right click on the Quebec Sales axis and select Synchronize Axes. (See Tableau Woes – Part 1 for more detailed instructions re. these steps. ) Now the display shows Quebec sales in one colour and national sales in another, making comparison and analysis possible.
  9. TableauWoes2-4

Tableau Parameters are another tool for controlling what is displayed. Parameters also make use of the Create Calculated Field function.

Hierarchy
The Hierarchy tool can also add interaction and dimensionality to a visualization, making it possible to drill down into detail or aggregate back up to bigger buckets. Here’s how it works:

  1. On a new worksheet, drag Product Sub-Category on top of Product Category in the Dimensions menu.
  2. TableauWoes2-5

  3. Give the Hierarchy a name, such as Product Hierarchy in the dialog box and click OK.
  4. TableauWoes2-6

  5. A new Dimension called Product Hierarchy will be listed in the Dimensions menu with Product Category and Product Sub-category listed under it.
  6. TableauWoes2-7

  7. To add Product Name simply drag it directly into the same Hierarchy.
  8. TableauWoes2-8

  9. Do the same with Customer Segment and Customer Name, and even Region and Province.
  10. Now the new Hierarchy pills can be dragged to the Row and Column shelves in the same way that any individual Dimension or Measure can be. For example, drag Product Hierarchy, Customer Hierarchy and Region Hierarchy to the Rows shelf and Sales to the Columns shelf and choose Horizontal Bar Graph type.
  11. TableauWoes2-9

  12. You can drill down into any of the Hierarchy pills on the Row shelf by clicking the small Plus sign beside the pill name or the Plus symbol that appears when you hover over the Product Category, Customer Segment or Region axis lables in the visualization. Similarly, once you have drilled down a level from, say, Region to Province, you can click on the little Minus sign on the Region pill or the Minus sign on the Region axis.
  13. TableauWoes2-10

It is worth noting that Hierarchy isn’t equally interactive for all viz types in dashboard view. A treemap, for example, doesn’t have any axes and I found it impossible to find a Plus or Minus sign to click. I imagine the same goes for a Bubble chart. If anyone has a solution for this problem, I’m all ears.



DataViz in 6 Weeks is my blog about teaching Introduction to Visual Analytics at OCAD University in Toronto. Comments, follows and shares welcome. #DataVizInSixWeeks

Anne Stevens I am a multidisciplinary designer working in data visualization, interaction design, innovation and critical design. I am particularly interested in non-screen based physical representations of data and tangible user interfaces.


Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/stevensa/public_html/wp-includes/formatting.php on line 3466