Today marks day 1 of my capstone project. I’m building a data pipeline from start to finish with the culmination of the project being two dashboards for a fictional stakeholder. One executive (overview) dashboard and an analyst level dashboard. While this project is a behemoth, I started the day by selecting my stakeholder then scoping out the first few days.

Stakeholder

I am building my dashboard/reports for the New York Housing Authority. For a long time, this sector of the city government has been receiving complaints from tenants for a long time about dilapidated housing conditions and callous effects of gentrification. They would like to address housing projects across the city in a strategic and equitable manner so they have brought me on to compile their data in an easy-to-understand format so that they can use the report to take action and repair housing projects accordingly.

Data Selection

One of the requirements for this project was to retrieve data from an API so I decided to use Alteryx to go about this process and the API I used was the US Census Bureau, specifically the American Community Survey. According to the U.S Census Bureau website: 

“The American Community Survey (ACS) is an ongoing survey that provides data every year—giving communities the current information they need to make important decisions. The ACS covers a broad range of topics about social, economic, housing, and demographic characteristics of the U.S. population.”

I wanted to use this data source to obtain granular demographic data for all the different tracts in New York City (think of a tract as a neighborhood, so there can be multiple tracts in one borough). I plan to couple this data with NYC Open Data: Housing Maintenance Code Violations to build out my dashboards.

Data Ingestion Workflow: ETL and Transformation

After selecting my data sources, I went into Alteryx to make my API calls to get my data. The first dataset I created by JSON parsing was a housing overview table that contains the median household income, vacant housing units and rent burdened households by tract. Due to the fact tract numbers can repeat in the Housing Maintenance Code Violations because several homes in the same tract can have violations, I had to create a unique GEOID using the state and county code so that I am not double counting any measure when I compute any aggregations.

Formula I used to create the GEOID

 Final table, 8 fields and 2,332 rows

I’m nearly done transforming the demographics table, but once that is done I’ll have all my raw data and I can begin drawing my schema.

Challenges

One of the first challenges I encountered was validating the table codes for when I made an API call. There are thousands of different variables that are measured in the American Community Survey but there are specific fields that my stakeholder was interested in so, with the help of Gemeni, I carefully parsed out all the tables that I needed access to for my dataset and grouped all those variables in my endpoint. I ended up using about 19 different variables and had to use Ctrl+F to check each code and ensure that I was returning the data I wanted to manipulate.

This is an example of one of the detailed table codes, as you can see each measure is partitioned by race so if I wanted to look at racial data for just one measure—like average household size—I would have to use 8 different codes!

Another challenge I ran into was an error message when I tried to fetch the data for my housing overview table. After running the download tool to just get the data for Manhattan and Brooklyn, I kept getting the following error message: "Failure when receiving data from the peer." I did some research internally and on the internet to no avail but one suggestion I found online was to query the data one county (borough) at a time because the server I am requesting from may not be able to parse comma separated values for the county parameter. Luckily this ended up working, but it meant that to get the data for the other boroughs I would have to fetch it one borough at a time then union all my tables. This was a very tedious process that took up more time than I wanted it to, especially since I was documenting along the way. But, in the end I got the following workflow.

Next Steps

Over the course of tomorrow and part of Wednesday I plan to:

  • Finish transforming demographic data
  • Create schema
  • Build tables in Snowflake