MIP Logo

Unpacking XML Data

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here. 

Introduction

Analysing my health data from Apple is one of the projects that I started before the Data School, but never managed to complete it because I didn’t have the skills to parse an XML, nor the right programs and strategies. Eventually I gave up and my XML data sat in my sad computer…until now.

Using Alteryx, dragged and dropped this XML file and transformed 3 million worth of rows in no more than two minutes.

Data Collection and Cleanup

I have been tracking health data for as long as I can remember. But since owning my own Apple watch around 2019, I get perhaps a little more obsessed with recording health data. Extracting the complete data was straightforward – just a click away on Apple’s Health app and about 10 minutes later (the earliest record available went all the way to 2016!), the zip file was ready.

If you don’t already know, here’s how: Head over to your Health app, click on your profile photo to view account settings, then select ‘Export All Health Data’.

   

I used a standard collection of Alteryx tools to clean up and transform the data. For this analysis, I’m using dataset from 21st June 2023, as that is the date I moved to Australia from Malaysia.

This is what the data looks like when I first imported it to Alteryx. The column [type] needs to be split into the different information it contains; whether the record is a Quantity or Category and what type of data it contains.

Using a couple of formula, I created two new columns – Type and Type_Identifier. The column Type contains either Quantity, Category, or Other. The column Type_Identifier contains information on the value of the data itself, such whether it’s a heart rate reading, blood oxygen level, or sleep duration, etc.

 

Now I have the columns that I need for further analysis, I output the workflow into a hyper file and loaded it to Tableau.

Visualisation

Now is time to answer some questions…

1. Does Amy really care about recording her health data?

 

2. When did she start taking it seriously?

 

3. What is her most consistent data collection platform/device?

 

4. Does she actually make any data driven decisions?

 

Conclusion

Amy is hypocritical. She collects data and she pretends to follow insights.

Share this post