Skip to main content
Question

How to group date according to date ranges?

  • July 21, 2021
  • 4 replies
  • 125 views

Forum|alt.badge.img

Hi,

I want to group materials and pipe length according to different age barckets (of say 2 or 5 or 10 years)...how could i do in FME?

Please see my sample data:



4 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • July 21, 2021

Hi @ppp19​ 

 

Your source data is not here.


Forum|alt.badge.img
  • Author
  • July 21, 2021

Hi @danilo_fme​ 

Attached snapshot from my data!


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • July 22, 2021

If you want to group by year you should first extract the value of the year.

Use DateTimeConverter set with Input Format %d/%m/%Y and Output Fomat %Y.

Than use AttributeRangeMapper. Use the Generate button to auto-create your ranges (input a min, max year and the number of ranges - do the math for 2, 5, 10 years).

Use the value of the range attribute (_looked_up by default) to group features


Forum|alt.badge.img
  • Author
  • July 27, 2021

If you want to group by year you should first extract the value of the year.

Use DateTimeConverter set with Input Format %d/%m/%Y and Output Fomat %Y.

Than use AttributeRangeMapper. Use the Generate button to auto-create your ranges (input a min, max year and the number of ranges - do the math for 2, 5, 10 years).

Use the value of the range attribute (_looked_up by default) to group features

Hi @caracadrian,

That worked perfectly according to my expectations. Thank you so much for your help.

Regards