logo-2015-v11

Learning Center


learning-center-white

Creating annual reports that group data by week

Posted by Pacific Timesheet Support on Oct 6, 2010 7:07:00 PM

Sometimes you need to summarize timesheet data by week over a longer period, such as a year. In Pacific Timesheet you can use sql expressions to create an annual timesheet report that groups or summarizes data by week. Normally when running timesheet reports, such as Employee Hours, the data is totaled for the entire reporting period. For example, the Employee Hours by Task report looks something like this when run year-to-date:

You can have this report summarize the data in weekly groups by using the following SQL as a grouping:

STR_TO_DATE(CONCAT(YEARWEEK(t_timeentry.strt,0),'0'),'%x%v%w')

This SQL is only valid for MySQL, but similar constructs can be made for Microsoft SQL Server and Oracle. When you group by this expression the hours data will now look like this:

report-emp-task-week.gif

Here you see the same data, only summarized by the week of the year.

A newer solution is Interval Reports found in the other reports section of the reports tab. Interval reports allow you to select an time interval such as a week, biweek, month or quarter over a defined time period.

Subscribe Now

 

Recent Posts