Hello ,
I am working on a form in which project managers will add an employee's working time as follows.
The decimal value shows the number of working hours for instance, 0.5 means EMP1 worked 80 hours on the project1
I need to do some calculations and break the days into working days and weeks to post those dates to the ERP system.
I was wondering if there is a way to break down the working time into days and working hours and remove the weekend.
Using the following formula, I could show the days and times in a table.
With({startDate:DateValue(_firstDayOfMonth),
// sequenceDays: Sequence(DateDiff(DateValue(_firstDayOfMonth),DateValue(_lastDayOfMonth)))
sequenceDays: Sequence(RoundDown(DateDiff(_firstDayOfMonth, _lastDayOfMonth, Days) / 7, 0) * 5 +Mod(5 + Weekday(_lastDayOfMonth)- Weekday(_firstDayOfMonth), 5))
},
ClearCollect(colDates,
AddColumns(sequenceDays,
"Date",
DateAdd(startDate, Value - 1, Days),
"Day Num",
"Day " & (Value),
"Day Name",
Text(DateAdd(startDate, Value - 1, Days),"dddd"
),
"WorkingTime", lbl_TimeAmount*160 / ( RoundDown(DateDiff(_firstDayOfMonth, _lastDayOfMonth, Days) / 7, 0) * 5 +Mod(5 + Weekday(_lastDayOfMonth)- Weekday(_firstDayOfMonth), 5))
)))
Thanks you!

Report
All responses (
Answers (