WOW S04 E32 : COVID-19 NEW CASE TRENDS

Rajeev Pandey
7 min readAug 13, 2020

By Pallavi Naik

WOW2020 WEEK 32 CHALLENGE LINK

Hello Readers !! Here is another #WOW challenge for the week from Luke, this week’s challenge is to show the COVID-19 new cases trend across all states of US using multiple tile map. This challenge uses the data from Tableau’s COVID-19 Data Hub, working with this data is extremely challenging. This challenge was created to help the participants learn how to use the data and grow data fluency in working with COVID-19 data.

Dataset — You can download the data set here

Before exploring this challenge, check out this blog on how to build small multiple tile map in tableau. Also some other interesting blogs like Spotlight Chart in Tableau.

STEP 1 — BUILD THE CALCULATIONS

  • Download and connect to the data source mentioned above in a new tableau workbook
  • To help the building of map onto different tiles easier, formula for Rows and Columns calculation is already provided below.
RowsCASE [Province State Name]
WHEN 'Alabama' THEN 7
WHEN 'Alaska' THEN 1
WHEN 'Arizona' THEN 6
WHEN 'Arkansas' THEN 6
WHEN 'California' THEN 5
WHEN 'Colorado' THEN 5
WHEN 'Connecticut' THEN 4
WHEN 'Delaware' THEN 5
WHEN 'District of Columbia' THEN 6
WHEN 'Florida' THEN 8
WHEN 'Georgia' THEN 7
WHEN 'Hawaii' THEN 8
WHEN 'Idaho' THEN 3
WHEN 'Illinois' THEN 3
WHEN 'Indiana' THEN 4
WHEN 'Iowa' THEN 4
WHEN 'Kansas' THEN 6
WHEN 'Kentucky' THEN 5
WHEN 'Louisiana' THEN 7
WHEN 'Maine' THEN 1
WHEN 'Maryland' THEN 5
WHEN 'Massachusetts' THEN 3
WHEN 'Michigan' THEN 3
WHEN 'Minnesota' THEN 3
WHEN 'Mississippi' THEN 7
WHEN 'Missouri' THEN 5
WHEN 'Montana' THEN 3
WHEN 'Nebraska' THEN 5
WHEN 'Nevada' THEN 4
WHEN 'New Hampshire' THEN 2
WHEN 'New Jersey' THEN 4
WHEN 'New Mexico' THEN 6
WHEN 'New York' THEN 3
WHEN 'North Carolina' THEN 6
WHEN 'North Dakota' THEN 3
WHEN 'Ohio' THEN 4
WHEN 'Oklahoma' THEN 7
WHEN 'Oregon' THEN 4
WHEN 'Pennsylvania' THEN 4
WHEN 'Rhode Island' THEN 3
WHEN 'South Carolina' THEN 6
WHEN 'South Dakota' THEN 4
WHEN 'Tennessee' THEN 6
WHEN 'Texas' THEN 8
WHEN 'Utah' THEN 5
WHEN 'Vermont' THEN 2
WHEN 'Virginia' THEN 5
WHEN 'Washington' THEN 3
WHEN 'West Virginia' THEN 5
WHEN 'Wisconsin' THEN 3
WHEN 'Wyoming' THEN 4
END
ColumnsCASE [Province State Name]
WHEN 'Alabama' THEN 8
WHEN 'Alaska' THEN 1
WHEN 'Arizona' THEN 3
WHEN 'Arkansas' THEN 6
WHEN 'California' THEN 2
WHEN 'Colorado' THEN 4
WHEN 'Connecticut' THEN 11
WHEN 'Delaware' THEN 11
WHEN 'District of Columbia' THEN 10
WHEN 'Florida' THEN 10
WHEN 'Georgia' THEN 9
WHEN 'Hawaii' THEN 1
WHEN 'Idaho' THEN 3
WHEN 'Illinois' THEN 7
WHEN 'Indiana' THEN 7
WHEN 'Iowa' THEN 6
WHEN 'Kansas' THEN 5
WHEN 'Kentucky' THEN 7
WHEN 'Louisiana' THEN 6
WHEN 'Maine' THEN 12
WHEN 'Maryland' THEN 10
WHEN 'Massachusetts' THEN 12
WHEN 'Michigan' THEN 9
WHEN 'Minnesota' THEN 6
WHEN 'Mississippi' THEN 7
WHEN 'Missouri' THEN 6
WHEN 'Montana' THEN 4
WHEN 'Nebraska' THEN 5
WHEN 'Nevada' THEN 3
WHEN 'New Hampshire' THEN 12
WHEN 'New Jersey' THEN 10
WHEN 'New Mexico' THEN 4
WHEN 'New York' THEN 10
WHEN 'North Carolina' THEN 8
WHEN 'North Dakota' THEN 5
WHEN 'Ohio' THEN 8
WHEN 'Oklahoma' THEN 5
WHEN 'Oregon' THEN 2
WHEN 'Pennsylvania' THEN 9
WHEN 'Rhode Island' THEN 11
WHEN 'South Carolina' THEN 9
WHEN 'South Dakota' THEN 5
WHEN 'Tennessee' THEN 7
WHEN 'Texas' THEN 5
WHEN 'Utah' THEN 3
WHEN 'Vermont' THEN 11
WHEN 'Virginia' THEN 9
WHEN 'Washington' THEN 2
WHEN 'West Virginia' THEN 8
WHEN 'Wisconsin' THEN 8
WHEN 'Wyoming' THEN 4
END
  • Now, we need to build few more calculations mentioned below to plot the graph for the increasing COVID-19 new cases
New CasesZN(LOOKUP(SUM([PEOPLE_POSITIVE_CASES_COUNT]),0))-ZN(LOOKUP(SUM([PEOPLE_POSITIVE_CASES_COUNT]),-1))

Above calculation looks at the current day cases and deducts the cases on the previous day, hence helps to find out the COVID-19 new cases for current day.

7-Day Avg New CasesWINDOW_AVG([New Cases],-6,0)

This helps to get the average of new cases starting previous 7th day and current day.

Max 7-Day AvgWINDOW_MAX([7-DAY Avg New Cases])

This helps us calculate and label the Maximum 7-day average of new cases.

STEP 2 — BUILD THE MULTIPLE TILE MAP

  • Add [Rows] to Rows shelf,right click on the field and change the type of field to Discrete and Dimension
  • Add [Columns] to Columns shelf,right click on the field and change the type of field to Discrete and Dimension
  • Add [Country_Alpha_3_Code] to Filters and select ‘USA’
  • Add [Report_Date] to Filters and select Range of Dates to filter on the date range that we need to visualize the COVID-19 new cases from ‘2020–03–01’ to ‘2020–07–31’
  • Add [Report_Date] to Columns and change the granularity to continuous date.
  • Add [7-Day Avg New Cases] to Rows shelf,right click on the field and change it to be continuous, also change the compute using to [Report_Date].
    This helps to plot the 7 day average of new cases across each day per state.
  • Add [Province_State_Name] to label under Marks card
  • Change the chart type to Area chart for measure [7-Day Avg New Cases]
  • Un-check the show header for [Rows],[Columns],[7-Day Avg New Cases] and [Report_Date]

At this stage, after following the steps mentioned above, the map should look like below:

Here if you notice, the problem to read the trend of new cases in each state is the uniform scale across which all states are measured. For example, California has reported maximum 7 day average COVID-19 new cases as 10,019 while states aligned on the same row, i.e, Utah and Colorado has reported maximum 7-day moving average on new cases 661 and 610 respectively, which is relatively low as compared to California.
When we plot this highly skewed data on the same scale, it makes the tile map quite difficult to read and analyze the trends of states were COVID-19 new cases were low. Hence, to address such issue, it is important to normalize the data.

Data Normalization is used to scale the data of an attribute so that it falls in a smaller range, such as 0.0 to 1. It is generally required when we are dealing with attributes on a different scale, otherwise, it may lead to a dilution in effectiveness of an important equally important attribute(on lower scale) because of other attribute having values on larger scale.

STEP 3 — NORMALIZING THE AXIS

  • Build the following calculated field
Normalized ValueWINDOW_AVG(([NEW CASES]/WINDOW_MAX([NEW CASES])),-6,0)
  • Replace the [7-Day Avg New Cases] with [Normalized Value] on Rows shelf. Right click on [Normalized Value] and change the compute using to [Report Date]
  • Add [Province_State_Name] in detail under Marks card for [Normalized Value]
  • On the Rows shelf, type MIN(1.5), this creates a placeholder measure. Right click on MIN(1.5) then click on dual axis and synchronize the axis for MIN(1.5) with [Normalized Value]
  • Change the chart type for MIN(1.5) to Line chart
  • Add [Province_State_Name] to label under Marks card for MIN(1.5)
  • Add [Max 7-Day Avg] to label under Marks card for MIN(1.5)
  • Add a reference line at constant value (0) for MIN(1.5) axis. This draws the zero line underneath each of the area chart. Refer the image below for the reference line.
  • Add the formatting changes for the tile map, turn off the Grid Lines, Ref Lines, Trend Lines, Axis Rulers, Axis Ticks, Zero Lines, Row and Column Dividers
  • Un-check show header for all the fields on the map.
  • Match the tooltips as expected.
  • Finally, add the worksheet title as shown in the image below.

STEP 5 — BUILD THE DASHBOARD

  • Create a new dashboard an add the multiple tile map worksheet to the dashboard.
  • Refer the image below for the final dashboard layout. You can also download the dashboard here for your reference.

We tried to cover as much as we could for a newbie to get started with Parameter Actions. Hope you like it. As always, We welcome feedback and constructive criticism. We can be reached on Twitter @rajvivan and @pallavinaik_ . If you enjoyed this blog, we’d love for you to hit the share button so others might stumble upon it. Please hit the subscribe button as well if you’d like to be added to my once-weekly email list, and don’t forget to follow Vizartpandey on Instagram!

Also, here are a few hand-picked articles for you to read next:

--

--

A passionate data evangelist, Tableau Zen Master, and DevOps practitioner dedicated to demystifying data and helping others discover insights through Data