Skip to main content
Question

Monthly average


Hi there,

 

I got crime data along with the date field. Now I want to calculate the Monthly average of crime data. For instance, Crime data for Janaury 2018, January 2019, and so on. Could anyone guide me how to do in FME?

3 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • February 4, 2020

Convert the date to a month attribute using the DateTimeConverter transformer.

Then use the Statisticscalculator transformer to do the math (group by the month attribute).

Hope this helps.


erik_jan wrote:

Convert the date to a month attribute using the DateTimeConverter transformer.

Then use the Statisticscalculator transformer to do the math (group by the month attribute).

Hope this helps.

If I want to calculate the monthly average over the last 5 years, would the same method be used to get the result?


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • February 4, 2020
muhammad_yasir wrote:

If I want to calculate the monthly average over the last 5 years, would the same method be used to get the result?

The described method will get you the monthly average for all the months that are in the data.

If the data goes back more than 5 years, you can limit that by using a Tester (testing that the date is larger than Feb 4, 2015).


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings