Pentaho

 View Only

 Nombre de jours ouvrés sans les jours fériés

  • Pentaho
  • Pentaho
Stephane TRAORE's profile image
Stephane TRAORE posted 03-23-2019 19:18

Bonsoir ! Comment peut-on calculer le nombre de jours ouvrés entre deux dates en tenant compte des jours fériés dans spoon ?


#Pentaho
Caroline Jacquet's profile image
Caroline Jacquet

Here is the translation of this question- "Good evening! How can we calculate the number of working days between two dates taking into account the holidays in spoon?"

Ravikumar Kamma's profile image
Ravikumar Kamma

1. If you consider Mon-Fri as a working days in a week then there is a function in calculator step (Date A - Date B (working days)).

2. If you are having additional holidays in between then that you have to pass as input and subtract that from #1

Linda Frembes's profile image
Linda Frembes

Stephane TRAOREBonjour! Did Ravikumar's response solve your issue? If so, can you please return and mark the answer as correct? If not, do you still require assistance?

La réponse de Ravikumar a-t-elle résolu votre problème? Si oui, pouvez-vous s'il vous plaît revenir et marquer la réponse comme correcte? Si non, avez-vous encore besoin d'aide?

Stephane TRAORE's profile image
Stephane TRAORE

Merci Ravikumar pour la réponse. Je m'excuse du retard. J'ai pu faire le #1. Mon problème c'est comment implementer le #2 à savoir extraire les jours feriés. Pourriez vous me faire un exemple ou m'expliquer quelles étapes de pentaho je peux utiliser pour le faire car je suis un débutant dans l'utilisation de pentaho. Merci.

Stephane TRAORE's profile image
Stephane TRAORE

Here is the translation of my answer : "Thank you Ravikumar for the answer. I apologize for the delay. I could do the # 1. My problem is how to implement the # 2 to extract the holidays. Could you give me an example or explain to me what pentaho steps I can use to do it because I am a beginner in the use of pentaho. Thank you.

Stephane TRAORE's profile image
Stephane TRAORE

Je m'excuse du retard. J'ai toujours besoin d'aide. Merci.

Linda Frembes's profile image
Linda Frembes

Ravikumar KammaAre you able to help Stephane TRAOREfurther? (See above replies.)

David da Guia Carvalho's profile image
David da Guia Carvalho

There are several ways to deal with this question, and without knowing most of the variables, it's hard to point a better way.

If your data comes from a DB witch is the most common scenario (like postgresql) and you have a table with your holidays it's quite easy, you could adapt  a query to your needs like this:

SELECT

data_p FROM generate_series('2019-01-01 00:00'::timestamp, '2019-07-01 00:00', '1 day') as data_pWHEREEXTRACT(DOW FROM data_p ) IN (1,2,3,4,5)

Add a holiday table and you got it.

If you have an e-calendar, you could parse an ICS (most of them have it) and that way you could sort all kinds of events (including holidays and days of week).

If you whants to generate a time serie in PDI... most of "time dimension" samples will cut it!

https://assignittous.com/2018/01/18/generating-date-dimension-table-pentaho-data-integration/

https://forums.pentaho.com/threads/52290-Time-Dimension-generator/

http://type-exit.org/adventures-with-open-source-bi/2010/09/building-a-detailed-date-dimension-with-pentaho-kettle/