Skip to main content
Question

How to group date according to date ranges?

  • Jul 21, 2021 4:17 AM UTC
  • 4 replies
  • 199 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+58
  • Celebrity
  • Jul 21, 2021 11:00 AM UTC

Hi @ppp19​ 

 

Your source data is not here.


Forum|alt.badge.img
  • Author
  • Jul 21, 2021 10:25 PM UTC

Hi @danilo_fme​ 

Attached snapshot from my data!


caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • Jul 22, 2021 5:22 AM UTC

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
  • Jul 27, 2021 12:03 AM UTC

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