Extreme Viz Makeover with Tableau: Unemployment Aid, The Washington Post

Data

Extreme Viz Makeover with Tableau: Unemployment Aid, The Washington Post

by Cory Jez

I came across an interesting article today on WashingtonPost.com by Niroj Chokshi. It visualized the impending effects of the estimated 1.3 million people that will lose unemployment benefits when they expire on Saturday Dec. 28. I won’t get into the politics of the issue, but I do think The Washington Post could improve on their visualizations by utilizing dynamic maps in Tableau. As such, I have recreated these visualizations by utilizing Tableau’s Dynamic Maps and Dynamic Number Formatting features. I also thought this would be a great opportunity to educate Tableau users on how they can implement Dynamic Number Formatting.

First, let’s check out the maps.

Dynamic Maps in Tableau

In The Washington Post’s example, we see a basic overview of the share of population affected on the state and county level:

Washington Post Vizzes

By utilizing Tableau’s out of the box mapping functionality, we can create dynamic visuals that not only shade by a certain measure, but also toggle between different measures and drill-down functionality to the county level. In the interactive dashboard provided below, I can examine those affected by toggling between per capita vs. total

Unemployment Aid Visualization by Cory Jez

It’s easy to see that the Tableau’s Dynamic Maps allow additional functionality for the reader, providing even greater value to the article. Now that we’ve seen how to express more information through Tableau’s mapping capabilities, we can move on to yet another way that Tableau adds value.

Utilizing Tableau’s Dynamic Number Formatting

For the Tableau users out there, I will discuss below how to utilize dynamic number formatting on the map. As we toggles between per capita and total measures, we have two different resulting numbers; one an integer (left) and the other a percentage (right).

Dynamic Number Formatting in Tableau 1

It is simple enough to put a dynamic measure parameter into the viz, but without formatting it appropriately, we see the California value at 0.014210822 instead of the simpler 1.42%. That’s where dynamic number formatting comes in.

This method takes advantage of the fact that all of our data is positive and “tricks” Tableau into thinking that one of our measures are negative and the other positive. Tableau then formats each differently. Let’s take a look at how it’s done.

Create a Calculated Field

We have a calculated field for our dynamic measure as follows:

Calculated Field for Dynamic Measure

Duplicate the Calculated Field

We then duplicate the calculated field, with one change: placing a “ – “ in front of the avg([Total Impacts]):

Calculated Field Duplicate

Now, we’re able to drop “Dynamic Number Format” onto our “Text” button on the marks card. From there, we can utilize custom formatting options to visualize our data appropriately.

Apply Custom Formatting

Right click on the new calculated field, “Dynamic Number Format,” and select “Default Properties” > “Number Format” to bring up the dialog box. When applying custom formatting, Tableau allows us to determine how to format positive and negative numbers differently. Usually, it does this so we can utilize parentheses or other accounting syntax. Since we have made [Total Impacts] negative here, we can format these fields differently. The example below allows the positive numbers to be formatted as percentages and the negative numbers as integers:

Dynamic Number Format Example

The resulting viz should now toggle appropriately between per capita and total with proper formatting.

Proper Dynamic Number Formatting

In Review

As a recap, here are the quick steps to utilize dynamic formatting across parameter-ized measures:

  1. Duplicate dynamic measure field and apply a “ – “ to one of the measures
  2. Apply duplicated field to your text button on marks card
  3. Edit default number properties for duplicated field, apply [format 1];[format 2]
  4. Toggle between measures in viz to check that formatting is working appropriately

How else could you utilize dynamic formatting in your visualizations?

More About the Author

Cory Jez

Business Intelligence Analyst
2014 FIFA World Cup Visualized in Tableau – Group G Outcomes If you cried as much as I did as the U.S. Men’s National Team settled for a draw against Portugal last night, then you’ve probably ...
Not Applicable is Applicable – Handling ‘N/A’ in Tableau Mapping Tableau’s “out of the box geocoding” functionality creates a wealth of opportunities for users to create beautiful maps almost ...

See more from this author →

Subscribe to our newsletter

  • I understand that InterWorks will use the data provided for the purpose of communication and the administration my request. InterWorks will never disclose or sell any personal data except where required to do so by law. Finally, I understand that future communications related topics and events may be sent from InterWorks, but I can opt-out at any time.
  • This field is for validation purposes and should be left unchanged.

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072