Skip to main content
Solved

Incremental date as a new feature

  • February 6, 2018
  • 5 replies
  • 21 views

fmeuser_gc
Contributor
Forum|alt.badge.img+9

I'm trying to get a range of dates as a new features.

For ex: if the date range is 02/01/2018 - 02/06/2018, Output features has to be like

02/01/2018,

02/02/2018,

02/03/2018,

02/04/2018,

02/05/2018,

02/06/2018

Any thoughts please? Thank You

Best answer by erik_jan

If you start with a parameter having the number of dates in the range and one for statdate:

Creator for a dummy object.

Cloner to create as many objects as dates in the range.

DateCalcukator to add a number of days using the _copynum from the cloner to the startdate.

And output the resulting dates.

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.

5 replies

fmeuser_gc
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • February 6, 2018

 

Tagging in @jlutherthomas, @Mark2AtSafe, @mark_1spatial, @erik_jan, @RylanAtSafe

erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • Best Answer
  • February 6, 2018

If you start with a parameter having the number of dates in the range and one for statdate:

Creator for a dummy object.

Cloner to create as many objects as dates in the range.

DateCalcukator to add a number of days using the _copynum from the cloner to the startdate.

And output the resulting dates.


fmeuser_gc
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • February 6, 2018

If you start with a parameter having the number of dates in the range and one for statdate:

Creator for a dummy object.

Cloner to create as many objects as dates in the range.

DateCalcukator to add a number of days using the _copynum from the cloner to the startdate.

And output the resulting dates.

@erik_jan - Didn't get you. Couldn't add number of dates in parameter

 

can you please provide test workspace?

 


erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • February 6, 2018
@erik_jan - Didn't get you. Couldn't add number of dates in parameter

 

can you please provide test workspace?

 

Sure, see attached daycreator.fmw

 

 


rylanatsafe
Safer
Forum|alt.badge.img+14
  • Safer
  • February 6, 2018

If you start with a parameter having the number of dates in the range and one for statdate:

Creator for a dummy object.

Cloner to create as many objects as dates in the range.

DateCalcukator to add a number of days using the _copynum from the cloner to the startdate.

And output the resulting dates.

If you are using FME 2017.1 or Newer, I would recommend using the DateTimeCalculator – likely has the same results, but has the advantage of being a native transformer vs custom transformer.

 

 

Edit: Although, there might be some additional config necessary to get that clone to work.. @erik_jan has crafted a nice approach.