Skip to main content
Solved

Create a list of dates based on starting date and interval


Forum|alt.badge.img

Hello, I'm trying to download a series of excel files that are on a website. There is a starting date of 9/19/2005 (its hyperlinked for each excel file) and it increments by 7 days (so its a page fill of hyperlinked dates). I'm guessing I need to create a list of all dates starting from 9/19/2005 so that I can use httpcaller to download each file. I'm having trouble creating the starting date so that I can use DateTimeConverter to create the range (and consequently create the full url's to each file). I tried using AttrubuteCreator with a new value of DateTimeCreate(2005,09,19) but this expression errors.

Thoughts on this and I'm all ears if there is a cleaner approach. Thanks in advance

Best answer by erik_jan

A similar question and answer can be found here:

generating-date-and-time-columns

Hope this helps

View original
Did this help you find an answer to your question?

6 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • Best Answer
  • March 3, 2020

A similar question and answer can be found here:

generating-date-and-time-columns

Hope this helps


Forum|alt.badge.img
erik_jan wrote:

A similar question and answer can be found here:

generating-date-and-time-columns

Hope this helps

Thanks erik, I'm looking through that workspace now and maybe I'll eventually get it but still quite confused. I changed the published parameter "Start Date" to be my 2005-09-19, however as i go through and alter this to fit my needs I get confused after the first cloner. I assume i basically need 780 "copies" since there is roughly that many weeks since year 2005. However after the first DateTimeCalculator how do i get it to generate a list of all those dates from my Start Date parameter through today?


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • March 3, 2020
jvickrey656 wrote:

Thanks erik, I'm looking through that workspace now and maybe I'll eventually get it but still quite confused. I changed the published parameter "Start Date" to be my 2005-09-19, however as i go through and alter this to fit my needs I get confused after the first cloner. I assume i basically need 780 "copies" since there is roughly that many weeks since year 2005. However after the first DateTimeCalculator how do i get it to generate a list of all those dates from my Start Date parameter through today?

I believe the DateTimeCalculator is set to add 30 minutes per record. You will need to change that to 7 days, multiplied by the _copynum from the Cloner.

Hope that helps. If not, let me know and I will try and change the workspace for your needs.


Forum|alt.badge.img
erik_jan wrote:

I believe the DateTimeCalculator is set to add 30 minutes per record. You will need to change that to 7 days, multiplied by the _copynum from the Cloner.

Hope that helps. If not, let me know and I will try and change the workspace for your needs.

Thanks Erik, I think I have the days incrementing by 7 but it only does it once so can you show me how to incorporate the cloner so that i get a full list of dates going from my start date of 2005-9-19 through today? Here is a snipet of what my model looks like currently and I'm using FME 2019 desktop

 

 

34598-date-time-intervals.fmw


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • March 3, 2020
jvickrey656 wrote:

Thanks Erik, I think I have the days incrementing by 7 but it only does it once so can you show me how to incorporate the cloner so that i get a full list of dates going from my start date of 2005-9-19 through today? Here is a snipet of what my model looks like currently and I'm using FME 2019 desktop

 

 

34598-date-time-intervals.fmw

Try using the Arithmetic Editor and use 7 * @Value(_copynum) instead of just 7. That should work.


Forum|alt.badge.img
erik_jan wrote:

Try using the Arithmetic Editor and use 7 * @Value(_copynum) instead of just 7. That should work.

That worked! thanks


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