FAQ: Weekly Statistics


Can I see the number of hits per week? Can I see a "top weeks" report?

Short Answer

Yes, by using the Calendar, and/or creating a database field and a report tracking "weeks of the year."

Long Answer

The date/time field in Sawmill tracks years, months, days, hours, minutes, and seconds. Each of these units fits evenly into the larger unit (24 hours in a day, 12 months in a year, etc.). Because weeks do not fit evenly into months, Sawmill cannot easily fit weeks into the date/time hierarchy. Still, there are several ways to see weekly statistics.

One way is to use the Calendar. In the Calendar, each week is represented as a link called "week"-- clicking the link applies a filter to the date/time field that shows the hits on those seven days. This lets you zoom in on a particular week, so you can see the statistics for that week, or you can switch to other views to learn more about the activity for that week. However, if you do it that way you can't see a list or graph of weeks, with the hits for each week, the way you can for days in the "Days" report.

If you need a weekly graph or table, you need to track the "week of the year" log field in your database. The week of the year is a number between 1 and 52 that represents the week of the year (e.g. 1 means January 1 through January 8, etc.). You can track the week of the year field like this:

  1. Open the profile file (Sawmill/LogAnalysisinfo/profiles/profilename .cfg) you want to add week_of_year reports to in your favorite text editor (notepad).

  2. Search for "database = {", then search for "fields = {" and scroll down until you see "day_of_week = {"

  3. Copy this line and all lines until the line "} # day_of_week" and paste it all just underneath.

  4. Where you see day_of_week in the new section change it to week_of_year (except use "string" where you see "display_format_type"), so it becomes:

          day_of_week = {
            label = "day of week"
            type = "string"
            log_field = "day_of_week"
            display_format_type = "day_of_week"
            suppress_top = "0"
            suppress_bottom = "2"
            always_include_leaves = "false"
          } # day_of_week
          week_of_year = {
            label = "week of year"
            type = "string"
            log_field = "week_of_year"
            display_format_type = "string"
            suppress_top = "0"
            suppress_bottom = "2"
            always_include_leaves = "false"
          } # week_of_year
      

  5. Then search for "reports = {" and duplicate (by copy/paste as above) an existing report (the Day of week report is a good choice), and again where you see day_of_week in the new section change it to week_of_year (except use "string" where you see "display_format_type").

  6. Then search for "reports_menu = {" and then "date_time_group = {" and duplicate (by copy/paste as above) an existing report menu (the Day of week report is a good choice), and again where you see day_of_week in the new section change it to week_of_year (except use "string" where you see "display_format_type").

  7. Save the changes you have made .

  8. Rebuild the database.

The new report will show you traffic for each week of the year.