Skip to main content
Question

Monthly average

  • February 4, 2020
  • 3 replies
  • 28 views

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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • 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.


  • Author
  • 30 replies
  • 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.

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+22
  • Contributor
  • 2179 replies
  • February 4, 2020

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).