Forum Discussion
COMPLEX WORKDAYS CALCULATION
- 2 years ago
Sundays and holidays are considered non-working days.Where is your table with the list of holidays?
How are you planning to handle tickets that were raised outside of the working hours, and/or were closed outside of working hours?
What granularity do you need? Hourly? Half Hourly? By the minute?
Working Hours = VAR a = GENERATESERIES ( [dataDeCriacao] * 1440, COALESCE ( [dataDePronto], TODAY () ) * 1440 - 1 ) VAR b = ADDCOLUMNS ( CALENDAR ( [dataDeCriacao], COALESCE ( [dataDePronto], TODAY () ) ), "Start", IF ( WEEKDAY ( [Date], 2 ) < 7, 480 ), "End", IF ( WEEKDAY ( [Date], 2 ) < 6, 1060, IF ( WEEKDAY ( [Date], 2 ) = 6, 720 ) ) ) VAR c = SELECTCOLUMNS ( GENERATE ( b, GENERATESERIES ( [Date] * 1440 + [Start], [Date] * 1440 + [End] - 1 ) ), "Value", [Value] ) RETURN DIVIDE ( COUNTROWS ( INTERSECT ( a, c ) ), 60, 0 ) - 2 years ago
It's working perfectly, but I just realized that I forgot one important thing! š„
I've left out the last table sent (beginners' mistake, I'm sorry!), the 'kanbanStatus' column which keeps track of the ticket's status:
- Pendente (Pending)
- Em andamento (In progress)
- Aguardando aprovação de orçamento (Awaiting budget approval)
- Feito (Done)
This information is crucial for the ticket study:
When the ticket is 'pending' or 'in progress,' the clock is ticking normally. However, when the ticket is set to 'Awaiting budget approval,' it is put on hold, and so the time should stop. 'Done' is when the ticket is solved.
You can view the RAW database through the following link: https://drive.google.com/file/d/1jA4DG9ZS0hp_5sCnj-sCD4HxhTAP9qpC/view?usp=sharing
- 2 years ago
You did include that column. Easy enough to add a filter yourself.
1) Where is your table with the list of holidays?
- Please see the link to the list of holidays (I uploaded them to a public folder on Google Drive): https://docs.google.com/spreadsheets/d/1IEhgI--mDPwfHgd7Gv1ae_YWUq88VTPcsGCTHfgFC-A/edit?usp=sharing
2) How are you planning to handle tickets that were raised outside of the working hours, and/or were closed outside of working hours?
Tickets raised and closed outside working hours must be realocated to the next workday/hour.
3) What granularity do you need? Hourly? Half Hourly? By the minute?
By the minute.
Thanks!
- lbendlin2 years agoSuper User
Tickets raised and closed outside working hours must be realocated to the next workday/hour.I don't know what that means. Can you please explain?
- rogerpoggi2 years agoRegular Visitor
The guiding principle of my logic is that if a person is working outside of regular working hours, that is their individual circumstance. It would be unrealistic to expect the same from other workers.
For instance, if a person opens a ticket at 5:35 pm on a Friday, it should be treated as if they opened it at 8 am on Saturday. The same logic applies to closed tickets. If a person closes a ticket at 8:45 pm on a Monday, it should be considered as closed at 8 am on Tuesday.
- lbendlin2 years agoSuper User
ok - my proposal should cover that.