29 Dec 2020

Tableau-dashboard COVID-19 in the Netherlands with CoronaWatchNL-data

 #72: Tableau-dashboard "COVID-19 in the Netherlands" with CoronaWatchNL-data

My previous post was about a Google Data Studio (GDS)  COVID-19 dashboard I made. GDS-reports are meant for viewing on a PC, not for mobile devices, as the GDS-canvas doesn't have a responsive design, although there is a way to make a (embedded) GDR-report reponsive, see e.g. : https://kpis.studio/blog/mobile-friendly-data-studio/

But I decided to make a new COVID-19 dashboard, this time with Tableau, as the Tableau-canvas does have a responsive design, or better said: a "device specific designer", see e.g. Design for mobile devices (device specific designer). And I also choose Tableau because I was inspired by the "Tableau & Visual Analytics inspiration-session' we had at work, in which I saw things of Tableau that I wanted to try myself. For the end-result of my first Tableau- experiment, see FIG.1. And for Tableau-workbook and the 'live' (embedded) dashboard, see the bottom of this post. And the live dashboard you can also find here:
https://public.tableau.com/shared/SH2PRJH77?:display_count=y&:origin=viz_share_link



FIG.1: my COVID-19 Tableau dashboard with responsive design, so works both for PC as mobile

To create my dashboard I used the free version of Tableau, Tableau Public 2020.3 (vs the Tableau Desktop client, for which you need a license). This version has the limitation that you can't save your dashboard locally, but only on the web, here:
https://public.tableau.com

So this makes your dashboard publically available once you saved (=published) it (for my dashboard that was on 2/12/2020). When I searched for my dashboard (using 'covid-19 netherlands'), I found it, with ranking #2 (se FIG.2). I'm not sure why my dashboard was ranked so high in the 35K(..) results for my search , but maybe it helped that my dashboard is automatically updated each day, which is not true for the other top 6 dashboards in FIG.2.  Later I'll explain how this can be done with Tableau Public, but this wouldn't have been possible of course if my datasource, CoronaWatchNL, wasn't updated daily as well (for more details about this datasource, see my previous post). 
Out of curiousity I checked if there were other COVID-19 dashboards that used CoronaWatchNL, and I found one, see FIG.3 
and for the (very nice) dashboard, see: 
https://public.tableau.com/views/CoronaMonitorNoord-Brabant/OntwikkelingNederland?:language=en-GB&:display_count=y&:origin=viz_share_link


FIG.2: my Tableau dashboard on Tableau Public cloud



FIG.3: (other) COVID-19 dashboards that use open data of CoronaWatchNL


Now more details about my dashboard:

Datasources

My dashboard has 2 datasource, the same 2 Google Sheets (that import data of CoronaWatchNL) that I used to create my Google Data Studio (GDS) dashboard. For the details of these datasources, see:
- Datasource 1: RIVM_NL_municipal_latest.csv 
- Datasource 2: RIVM_NL_national.csv
Remember that these Google Sheets get updated automatically as soon as CoronaWatchNL has new data. And to get a 'live' dashboard in Tableau Public, you have to select 'Keep my data in sync with Google Sheets..' when you save the Tableau-workbook, see for more details e.g.:


https://www.thedataschool.com.au/nicholas-hills/how-to-create-a-dynamic-dashboard-for-coronavirus-with-google-sheets-and-tableau/

For datasource-1, with geo-data, I set the 'Geographic Role' for the geo-columns as Country :



And for field 'Type' (of COVID-19 case), which has (3) possible values and are in Dutch in the datasource, I created alias-values in English:




Dashboard and Charts

The 2 charts you see in the dashboard have different datasources: 
the Map-chart uses Datasource 1(RIVM_NL_municipal_latest.csv)  and the Line-chart uses Datasource 2 (RIVM_NL_national.csv). So these charts are not 'connected' (filtering in one chart has no effect on the other chart).

I made 2 dashboard-versions, one for PC (see FIG.4a) and one for mobile phone (see FIG.4B).

FIG.4a: PC-dashboard



FIG.4b: Mobile-dashboard + designer

I started with the one for PC (desktop), and this one I used as a start the the mobile version. I wanted to fit both the Map-chart and the Line-chart in one screen (of a mobile phone), so that the mobile user has (more or less) the same user experience as the PC user, so he can see the current state of COVID-19 in the Netherlands by city (in the Map-chart) and the COVID-19 'curve' (the Line-chart).
For this, I had to eliminate some widgets (e.g. the date-and location-filters). If the mobile user would like to see more details or have more interaction-options (for filtering), he should use the PC-dashboard.
NB: I could have been better to use different 'tabs' for the map- and line-chart, see for an nice (responsive) dashboard that does this: https://covid19.innouveau.com/#/
(TODO)

To get the 2 charts in the mobile dashboard (vertically) aligned and fitting in 1 screen, I used a Vertical Container. For more details how this works, see e.g. :
How to Lay Out a Dashboard in Tableau


Map-chart 

I made the (Dual-axis) Map-chart, with the colored Provinces and sized Cities/Municipalities, following this Tableau Tutorial ("Maps with shaded States and sized Cities"):
https://www.youtube.com/watch?v=3VAolG-YEa0 
It's a pity that many locations on the map are unrecognized.
I checked with a Tableau expert at my work, and she said:
"With Tableau maps there is a limitation, in the sense that it cannot plot all the locations automatically. This can be overcome with custom geocoding (they offer resources for that online)"
(TODO) 
I did solve the issue for one city (The Hague, in Dutch: 'Den Haag' or 's‑Gravenhage) manually, see FIG.5 how I did this.

FIG.5: screen to manually fix unrecognized locations


The map has the option to drill-down (province -> city/municipality), see FIG.6.
For this, I created a 'geo-hierarchy' in the dataset, see FIG.7

FIG.6: Drill-down for province Zuid-Holland to municipality Zwijndrecht



FIG.7: Map-chart with datasource


Line-chart

The line-chart shows both the total (in orange) and new (in blue) COVID-19 cases, where you can select which metric to use for #case:
  • Diagnosed ('Totaal')
  • Hospitalized ('Ziekenhuis opname')
  • Deceased ('Overleden')


FIG.8: Line-chart with datasource


Story

Besides dashboards, you can also create 'stories' in Tableau. As written here:

.. a story is a sequence of visualizations that work together to convey information. You can create stories to tell a data narrative, provide context, demonstrate how decisions relate to outcomes, or to simply make a compelling case.

..a story is also a collection of sheets, arranged in a sequence. Each individual sheet in a story is called a story point.

And for how to create a story in Tableau, see: 
https://help.tableau.com/current/pro/desktop/en-us/story_create.htm

In my story (see FIG.9), there are 3 'story-points', which are the line-charts for the 3 different metrics (Diagnosed, Hospitalized, Deceased) and this story I could use if I would like to ask to someone with more knowledge of the COVID-19 situation in the Netherlands (NL), why in the Diagnosed-chart there was no 'spike' in the outbreak (in April 2020) of  COVID-19 in NL while in the Hospitalized/Deceased-charts there is a spike for the 1st wave (answer would probably be: there was almost no testing then).


FIG.9: Story (2 of the 3 story-points) with the line-chart for different metrics

N.B:
In this post I marked some pending things in my dashboard with "TODO" . I might do this later... 


References

https://public.tableau.com/en-us/s/covid-19-viz-gallery

https://www.tableau.com/covid-19-coronavirus-data-resources

https://www.tableau.com/covid-19-coronavirus-data-resources/global-tracker

https://public.tableau.com/profile/deloitte.visual.analytics#!/vizhome/DeloitteCOVID-19EconomicRecoveryDashboard/DeloitteCOVID-19Analysis

https://help.tableau.com/current/pro/desktop/en-us/default.htm

Tableau Desktop vs Public vs Reader


Downloads

Tableau-workbook


Embedded (live) Dashboard

i-frame:

<div class='tableauPlaceholder' id='viz1609218470236' style='position: relative'><noscript><a href='#'><img alt=' ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;CO&#47;COVID-19NetherlandsmapwithopendataofCoronaWatchNL&#47;Dashboard1-PC&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz'  style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='COVID-19NetherlandsmapwithopendataofCoronaWatchNL&#47;Dashboard1-PC' /><param name='tabs' value='yes' /><param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;CO&#47;COVID-19NetherlandsmapwithopendataofCoronaWatchNL&#47;Dashboard1-PC&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /><param name='language' value='en-GB' /><param name='filter' value='publish=yes' /></object></div>                <script type='text/javascript'>                    var divElement = document.getElementById('viz1609218470236');                    var vizElement = divElement.getElementsByTagName('object')[0];                    vizElement.style.width='100%';vizElement.style.height=(divElement.offsetWidth*0.75)+'px';                    var scriptElement = document.createElement('script');                    scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                    vizElement.parentNode.insertBefore(scriptElement, vizElement);                </script>



29 Nov 2020

COVID-19 in the Netherlands live dashboard with Google Data Studio and open data of CoronaWatchNL

 

#71: "COVID-19 in the Netherlands" live dashboard with Google Data Studio and open data of CoronaWatchNL

In march I made my first "COVID-19 in the Netherlands dashboard", in Microsoft Power BI , based on the open data on:  https://github.com/J535D165/CoronaWatchNL
made by:  Jonathan de Bruin of Utrecht University 
and for the post about that dashboard, see: 
https://worktimesheet2014.blogspot.com/2020/03/coronovirus-in-netherlands-power-bi.html

Last week I got news from J. de Bruin that his CoronaWatchNL project won the 'Dutch Data prize', a prize for researchers who make (research-)data available for further research, so to offer it as open data, or as much open as possible, also called fair data.  For more details about this prize and CoronaWatchNL, see:

https://www.uu.nl/en/news/jonathan-de-bruin-wins-dutch-data-prize-with-his-project-coronawatchnl

https://zenodo.org/record/4278891#.X7UUishKiUk

https://researchdata.nl/diensten/dataprijs/

https://www.go-fair.org/fair-principles/

and for a video with the award ceremony with J. de Bruin, see: 

https://www.youtube.com/watch?v=uSJ_2_c_xt4&list=PLGCrt17ZLM3SkHfWvjM8j401D8tR35Wk4&index=2

(starting at min. 8:53).

In the email that J. de Bruin sent to me and some others who participated in his project, to tell us the news, he said that this award was also ours, although I must say my contribution was relatively small compared to the tremendous work he did (and still does). 

The success of CoronaWatchNL stimulated me to make a new (and better) dashboard, as my first one was not up-to-date anymore. To refresh the data in that (Power BI) dashboard I had to do some manual work because the datasource was a local CSV-file, which I downloaded daily  from CoronaWatchNL, and that I than processed in my (local) Power BI report, which in the end I had to upload to the Power BI cloud.  
The new 'live' dashboard for the CoronaWatchNL data, I made with Google Data Studio (GDS), which has a datasource a Google-Sheet with a formula that imports the CoronaWatchNL data, and gets automatically refreshed once the CoronaWatchNL data is updated (daily at aprox 16:00). 
The 'dashboard' actually consists of 2 GDS-reports, in 2 UX-flavors (a: Light theme and b: Dark theme), see FIG.1-4 for the screenshots, the URLs and the i-frames of the 4 reports (for embedding the report in a website). And at the end of this post, you can also see the embedded reports (which are always up-to-date).


FIG.1a: COVID-19 in the Netherlands dashboard (part 1/2) - Number of cases by province and city (Light theme)



NB: 
- report says 'City', but it is actually 'Municipality'.
- the data in the top-right of the header is the date of the datasource, which is refreshed at aprox. 16:00. 


FIG.1b: COVID-19 in the Netherlands dashboard (part 1/2) - Number of cases by province and city (Dark theme)

https://datastudio.google.com/s/vNqnsHxKDkI

<iframe width="600" height="450" src="https://datastudio.google.com/embed/reporting/ddb639ef-c243-4941-854e-ef10845a1658/page/xuVpB" frameborder="0" style="border:0" allowfullscreen></iframe>




FIG.2a: COVID-19 in the Netherlands dashboard (part 2/2) - Number of cases over time  (Light theme)




FIG.2b:  COVID-19 in the Netherlands dashboard (part 2/2) - Number of cases over time  (Dark theme)

https://datastudio.google.com/s/vQqMgu-tdfg

<iframe width="600" height="450" src="https://datastudio.google.com/embed/reporting/d0e15dd4-e4e0-46a1-9879-ccd5353a5c42/page/lPmpB" frameborder="0" style="border:0" allowfullscreen></iframe>



If you want to use the URLs above in your website, but you want to use a different filter than the default filter, then copy the URL after you applied the filter. As you can see in FIG.3, the URL now has the applied filter in it. 
This is because I enabled the 'custom bookmark links' feature of GDS for the dashboard. See:  https://www.clickinsight.ca/blog/using-bookmark-links-in-data-studio


FIG.3: URL with filter Province = 'Zuid Holland'



The dashboard is interactive, so you can filter, drill-down or choose different metrics, see FIG4 a-b. for some examples. 

FIG.4a: Drill down for Province = 'Zuid Holland' to City




FIG.4b: change the (default) metrics (total/new numbers) for the optional metrics (percentages) 




The datasources I used for these reports are:

Datasource 1: RIVM_NL_municipal_latest.csv

https://docs.google.com/spreadsheets/d/1lKWmtYl5hhnlHzqQv2Y6PQcadVdNuI0Pz-VxttRICeA/edit?usp=sharing

=ImportData("https://raw.githubusercontent.com/J535D165/CoronaWatchNL/master/data-geo/data-municipal/RIVM_NL_municipal_latest.csv")


NB: 
The grey-columns are not from the CoronaWatchNL file, but extra columns that I added. E.g. column 'Municipality' (shown as 'City' in the GDS-report) replaces the '-1' value of the original column to 'ZZ Unknown'.

Datasource 2: RIVM_NL_national.csv

https://docs.google.com/spreadsheets/d/1Z9gWo6U3B_GIOsnewwNrqzASaNzW56-Y2hwi207_n3Y/edit?usp=sharing

=ImportData("https://raw.githubusercontent.com/J535D165/CoronaWatchNL/master/data-geo/data-national/RIVM_NL_national.csv")


NB:
*1: The datasources have 1 row per metric (see column 'Type'), and as there are 3 metrics, there are 3 rows per date and location (for datasource 1) or per date (for datasource 2). Therefore it's necessary to filter in the report or chart which metric-type you want to display. An alternative would have been to 'pivot' these 3 rows to 3 columns, so then there would be only 1 row per date and location (for datasource 1) or per date (for datasource 2), and so then the table would be like a 'normal' fact-table (in BI-terms). 
*2: In the datasource there are some records with negative numbers, which are corrections I guess. I choose to not plot them in the chart, as these are exceptions and could lead to confusion.

FIG.5: negative numbers (corrections)  in datasource



For the dashboard (4 GDS-reports), I enabled Google Analytics, so I can see the usage. Here you can see how this can be done:
https://datastudiotemplates.com/how-to-track-your-google-data-studio-report-usage-with-google-analytics/

One of the sharing options of GDS is by scheduled email. If you are interested in this, please let me know, and I can add you to the mail-list.

To conclude this post I wanted to say congratulations to Jonathan de Bruin and all other people who work on the CoronaWatchNL project, and keep up the good work!


Embedded Google Data Studio report

COVID-19 in the Netherlands dashboard (part 1/2) - Number of cases by province and city (Dark theme)





COVID-19 in the Netherlands dashboard (part 2/2) - Number of cases over time  (Dark theme)




Interesting Links about GDS

How to create a [Google Data Studio] dashboard for coronavirus:
https://www.youtube.com/watch?v=_CNnparrSgs

GDS-tutorial:
https://blog.hubspot.com/marketing/google-data-studio

https://michaelhoweely.com/2019/02/26/filtering-data-using-a-geo-map-region-in-google-data-studio/

https://geofli.com/blog/report-location-data/

https://stackoverflow.com/questions/23177356/how-to-force-new-google-spreadsheets-to-refresh-and-recalculate

https://hevodata.com/learn/google-data-studio-filter/