How do I subtract?

Hi Gays , I need your help :slightly_smiling_face:

I have the total number of hours worked which is “40:00:00” and I have the number of hours worked for each employee.
How do I subtract the employee’s hours worked from the total hours worked?
Then I check whether the number of hours worked by the employee is equal to the number of hours worked or less


per week ?
and total number of hours always 40 ?

Yes Per Week and always 40


Assign totalHoursWorkedString = “40:00:00”
Assign employeeHoursWorkedString = “35:30:00”

Assign totalHoursWorked = TimeSpan.Parse(totalHoursWorkedString)
Assign employeeHoursWorked = TimeSpan.Parse(employeeHoursWorkedString)

Assign remainingHours = totalHoursWorked - employeeHoursWorked

Assign isEqualOrLess = remainingHours <= totalHoursWorked

1 Like


totalHours = TimeSpan.Parse("40:00:00")

For Each hour in employeeHoursList:
      hourDiff = totalHours - TimeSpan.Parse(hour)
      if (TimeSpan.Parse(hour) <= totalHours):
             Then "Continue next process"
1 Like


Please refer the below workflow for the above requirement.

Sequence1.xaml (8.6 KB)

Hope it will help you.

1 Like

(subtraction , NumOfHoursWorked ,totalNumOfworked) type : timeSpan
edit the condition to
or to
NumOfHoursWorked < totalNumOfworked

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.