Today, we had the difficult task of obtaining data from the Food Standards Agency through an API. We used an XML parse, which is a tool that I had never used before. However, it turned out to be pretty simple to use!

My Alteryx workflow looked like the following:

First we had to generate rows to get all the pages that we needed for London. Earlier, we tried getting data for the whole of the UK, however, this took too much time to download, so we decided to stick to London instead. This worked out well for my multiple map chart in Tableau.

We then used a formula tool to replicate the URL from scratch using the input from generate rows.

We downloaded the data and then parsed it out and then used the crosstab tool to get the data in the correct structure.

We also added an extra bit in the end to get a tile map for our data. This essentially uses the grid tool and matches this to the points of each restaurant, created using the “create points” tool and outputted the data into Tableau.

This is what I ended up creating in Tableau.

Click on the pic to see the viz on Tableau Public.

I used Mapbox to custom design the map background from the default map called Decimal. I took off most of the layers and changed the colours of the road to create the effect of my viz.

I then used the following calculated fields to get the multiple map view.

Case Columns:

Case DATEPART(‘year’ ,[Rating Date])

when 2011 then 1

when 2012 then 2

when 2013 then 3

when 2014 then 4

when 2015 then 1

when 2016 then 2

when 2017 then 3

when 2018 then 4

end

Case Rows:

Case DATEPART(‘year’ ,[Rating Date])

when 2011 then 1

when 2012 then 1

when 2013 then 1

when 2014 then 1

when 2015 then 2

when 2016 then 2

when 2017 then 2

when 2018 then 2

end

I then put average rating score on colour to see the differences across time and location.

Finally, I added a viz in tooltips, which looked like this: