Solved

Create a list of dates based on starting date and interval

  • 3 March 2020
  • 6 replies
  • 45 views

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

icon

Best answer by erik_jan 3 March 2020, 18:40

View original

6 replies

Userlevel 2
Badge +16

A similar question and answer can be found here:

generating-date-and-time-columns

Hope this helps

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?

Userlevel 2
Badge +16

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.

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

Userlevel 2
Badge +16

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.

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

That worked! thanks

Reply