Question

Splitting an intervall by using calculation formula functionality

  • 15 September 2023
  • 1 reply
  • 43 views

Userlevel 1
Badge +3

Hi Community!

 

I have an interesting task by one of my customers. He wants to be able to be able to analyze his employee’s working times before and after 20:00 o’ clock.

My idea is the following:

I want to use the calculation formula functionality for doing this in combination with the additional result calculation and 2 different balances (one for working time before 20:00 and one for the time equal or larger than 20:00)

For example the employee clocks in at 13:00 and has an interval from 13:00 until 21:00. In this interval there is a flexible break of 0,5 hours.

Now I am looking for a calculation formula which splits this intervall:

Intervall 1 after split: 13:00 until 20:00 so 7 hours in total with a break of 0,5 hours, so 6,5 hours worked when deducted the break

Intervall 2 after split: 20:00 until 21:00 so 1 hour in total

The total worked hours will be changed to wage codes for balance accrual by using the additional calculation setup.

Does anybody have an idea how the calculation formula would have to look like? Is it even possible to do something like this?

Thank you all in advance for your ideas!

 


1 reply

Badge +2

Hi Frank,

could you please elaborate the use case a bit further? What comes to my mind would instead of using the Calculation Formula be to

  1. define the Day Type to use different Wage Codes from the specified hours
  2. create an Increment Type to create additional Wage Codes

If you’d use the calculation Formula you could try the following:

  1. create a Field for saving numbers
  2. Count number of clockings
  3. get Last Out-Clocking
  4. Get Time From Date
  5. Store Time in #1
  6. Subtract 20h from #1
  7. Set #1 as Result hours for your specified Wage Code

There will be better ways (e.g. using While to subtract the number of hours and minutes and store them into calculation fields which you finally can use to set your result hours, but it’s worth a shot.  

Reply