Dashboard Week Day 3
Another day, another cheery topic! We have gone from UK Crime to Migrant Stock to today’s topic: Risk Factors for Noncommunicable Diseases.
Requirements as per Andy’s blog:
- The data set is of risk factors for non-communicable diseases, which can be found within each of the data downloads pages on NCDRisC.org.
- Use Alteryx to download the data for all countries available.
- Use Tableau to create a visualisation.
NCD Risk Factor Collaboration (NCDRisC) provides data on four major risk factors for non-communicable diseases for all of the world’s countries. The data is readily available to download in one global .csv for each of the four risk factors from the website, but that would be too easy for Dashboard Week!
The Four Risk Factors:
I actually used the height data for my DS application viz way back when. Then I used it again for the week 1 project – application makeover. I feel like I have exhausted the topic, so for today’s challenge I will be looking at Adiposity (aka Obesity,) Diabetes, and Blood Pressure.
Because no challenge is complete without Alteryx, Andy wants us to download one file for each country, for each risk factor and then join them all together. It was a lot easier than I thought it would be. Here is a quick summary of the steps I took:
Container 1 -Download .csv files to my PC
- Get a list of all the available countries and put them into a File Input tool
- Create a Text Input tool with a list of the URLs for the three factors
- Combine the tools from steps 1 and 2 using an Append tool
- Use a Formula tool to create an URL for each country and define a download location for the file.
- Create the specified folders in Google Drive
Container 2 – Union all 600 files into one .yxdb
- Add three Dynamic Input tools to your country list file, which now doubles as a list of file names. One tool for each folder, to dynamically import all the .csv files. For whatever reason, the Adiposity files don’t contain a Country column, so I configured the import to tool to add a field from FileName.
- Add a Select tool after the Adiposity import to rename the FileName field to Country
- Add 3 Transpose Tools to make our field names consistent.
- Add 3 Multi-Row tools to generate a risk factor field
- Union all the tools
- Output to a .yxdb (NOTE: I tried outputting directly to a .tde but I kept getting an error message saying the .tde failed to generate. So I did the next best thing and output to an Alteryx database file.)
Create the .tde
Now we are ready to viz! I created a Pinterest board for design inspiration. I might have to start making my Pinterest boards private, with all the sunny topics we have had this week my mom complained that they are depressing her.
Check back tomorrow to see the fab dashboard I created!