Last month we created the visualization to depict the daily volume of speed violations that have occurred in Children’s Safety Zones for each camera in Chicago. I tried to see number of violations in each area in Chicago from 2014 to 2016.
There were few areas where the speed violations were massive as compared to other areas. Those speed violations kept on increasing in higher numbers for next year. Also there are areas like “4843 W Fullerton” where number speed violations increased from 2014 to 2015 by 82211 but in 2016 it decreased by 15843 which shows us the efforts of the traffic police department to decrease the speed violations.
Below is the link which shows the changes in amount of violations in Chicago from 2014 to 2015 and from 2015 to 2016.
https://drive.google.com/open?id=0B8ffu231haBVeHdkYVo0d1YzdDA
In order to get the picture of increase and decrease in number of speed violations in every area following steps were carried out on Tableau:
- Get the number of speed violations separately for each year based on Violation Date field. To get only the number of speed violations for particular year, I took three calculated fields each consisting the violations of year 2014, 2015 and 2016.
- To achieve this from violation date I extracted only year using YEAR function. For example to get the number of speed violations for year 2014, Violations_2014 calculated field was created with code: If YEAR([Violation Date]) == 2014 THEN [Violations] END.
- Once we have the amount of speed violations for each year separately then we can take the difference between any 2 years to get the depiction of increase or decrease in the number of speed violations.
- To see the amount of increase and decrease in year 2015, we can create calculated field as Difference_2015 with code: SUM([Violations_2015]) – SUM([Violations_2014])
- Step 4 is to be repeated to get the change in speed violations for year 2016 with code: SUM([Violations_2016]) – SUM([Violations_2015])
- Once we have the amount of change in speed violations for each year we can plot the graph with the Address field on Y-axis and change in speed violations on X-axis.
This can be done in different ways in Tableau. I followed this approach to get the detailed step by step understanding of the data. Your comments are welcome for any alternate or better approaches to get the same visualization.