Groupby Sum Timesheet Repeating group search slow

Hi All,

i currently have a data table with the following fields:

  • Employee (type)
  • Project (type)
  • Timesheet (type)
  • MonNorm (number)
  • MonOT (numbr)
  • TuesNorm (number)
  • TuesOT (number)
  • WedNorm (number)
  • ThursNorm (number)
  • ThursOT (number)
  • FriNorm (number)
  • FriOT (number)
  • SatNorm (number)
  • SatOT (number)
  • Sunday (number)

Now each timesheet can have an entry for the same person for each project were currently working on with the number of hours for both normal and overtime shown per project.
I made a separate sheet that will sum up each persons total hours on that timesheet by using a repeating group on employee (good it shows missed users too) and then using a search for each of the numbers(x13) and :sum. If the timesheet has 30 people on it then it is doing 30x 13 search:sum’s which shows up like the numbers are getting typed slowly onto the timesheet. Quick check in chrome shows that it is doing an request to the server for each of those 30x13 items which is terrible?.

Is there a better way to do this?



Not sure I follow completely what you are saying but perhaps a better way to do your table is as follow (based on what you are showing):

Employee Table:
Employee (type)
Project (type)
Timesheet (type)
List of Days (list of days table)

Days Table
Day of the week (example number 1 or text “Monday”)
Actual date (date)
Normal Hours (number)
Overtime Hours (number)

Your logic will shift significantly with this approach.

Actually to be more realistic since you are going to have many weeks. You might consider a list of weeks which is made of a list of days.

Hope this helps more than it confuses you… perhaps others can weigh in…

I do think this will just complicate the rest of the design and does not avoid the issue of having to sum each day if they went to 3 projects on the same day?

Is the timesheet format

Is the timesheet totals format

Its designed to be similar to what the company already has done on paper.

My issue is with the performance of summing up for each employee how many hours they spent each day at work total.

Would it be better to have a field on the user for each day for Hours, and a separate for OT, that every time you save the hours on the project, you’re adding those hours to the field on the user? In my mind, since you’re writing to the database directly, instead of doing a derived calculation, this should really speed up the loading of the data. Instead of summing 13 values, you’re just looking up one value.

I ended up going with a separate table called TimesheetSummary that just sums up all the projects for a user every time the data is updated in the time sheet giving me the normal/OT hours each day across all projects. Seems more efficient because its just 1 update call rather then 130 odd.

Hi Adam, I want to create a timesheet for my app users where user are able submit the timesheets based on the contract requirement. For example, if their requirement starts on Oct 12 and finish on October 15, they should be able to submi it. Can you please let me know if you may have a similar solution?