Skip to main content
Solved

Returning dates excluding non working days


I have some start and end dates for activities. The start dates need to be created in FME using the previous activities end date plus one day, however if this date falls on a weekend I need to tell it to return the next working day. It would be even better if I could also exclude bank holidays along with the weekends.

 

Any thoughts or ideas on how to do this would be greatly appreciated!

Best answer by jdh

If I was doing just the first half, I would use a conditional value in an attributeCreator.

ie, add 3 days to friday, 2 to saturday and 1 for every other day. %w returns a value from 0 -6 with 0 being sunday.

 

 

For bank holidays and the like, I would look into an API. Something like https://holidayapi.com/ if you want a commercial solution, or there are free country based apis like https://canada-holidays.ca/api.

 

 

The alternative would be to have a file/database with all the holidays that you would have to maintain.
View original
Did this help you find an answer to your question?

2 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • July 13, 2020

If I was doing just the first half, I would use a conditional value in an attributeCreator.

ie, add 3 days to friday, 2 to saturday and 1 for every other day. %w returns a value from 0 -6 with 0 being sunday.

 

 

For bank holidays and the like, I would look into an API. Something like https://holidayapi.com/ if you want a commercial solution, or there are free country based apis like https://canada-holidays.ca/api.

 

 

The alternative would be to have a file/database with all the holidays that you would have to maintain.

  • Author
  • July 14, 2020
jdh wrote:

If I was doing just the first half, I would use a conditional value in an attributeCreator.

ie, add 3 days to friday, 2 to saturday and 1 for every other day. %w returns a value from 0 -6 with 0 being sunday.

 

 

For bank holidays and the like, I would look into an API. Something like https://holidayapi.com/ if you want a commercial solution, or there are free country based apis like https://canada-holidays.ca/api.

 

 

The alternative would be to have a file/database with all the holidays that you would have to maintain.

Thanks that works great!


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