Report generation: more information

Friday 4 February 2005 Mathieu Lutfy

Here is a bit more information to clarify what type of reports we want to be able to generate. Most of it is based on what Antzi already wrote, this document only extends it.

IT IS IN NO WAY COMPLETE, but a draft implementation is working (outside CVS). This draft implementaion is only analysis for now.

Examples

1- Time sheet

- List activities (time start, type activity, description, time spent) for Author X in month Y.
- Show a column total of time spent
- Filters: Author ID, Date interval

Example report result:

Time startActivityDescriptionTime spent
9h00Consultation...1h
10h00ReadingResearched law concerning xyz2h
13h00TravelMet with client1h
14h00ConsultationTalked with client2h
16h00TravelWent back to office1h
17h00OtherReported my activities30m
Total------7h30

2- Activity types

- List the hours spent on each type of activities for each author in month X.
- Show a line total for sum of time spent
- Possibly, show only for a specific case
- Filters: Date interval, Case ID (optional)

Example report result:

Author nameReadingInterviewTravelOtherTotal
Alice3h455h154h001h0014h00
Bob3h304h002h002h0011h30

2b- Average activity types

- How many hours are spent in average for each activity types for all cases in month X?
- Filters: Date interval

Example report result:

Author nameReadingInterviewTravelOtherTotal
Alice2h003h152h001h008h15
Bob1h302h001h002h006h00

3- Monthly case overview by author

- Show how many cases were opened, closed and appealed, for each author, in month X.
- Show total for each column (either average or sum).
- Filters: Date interval

Example report result:

Author name#cases opened#cases closed#appeals
Alice541
Bob420

4- Case activity for each stage

- Show how time was spent for each case stage.
- Show sum of hours for each row
- Show sum of hours for time column
- Filters: Case ID, Author ID (optional)

Example report result:

StageReadingInterviewTravelOtherTotal
Investigation1h10h2h1h14h
Pre-trial3h2h1h0h6h
Trial4h2h1h1h8h
Appeal2h0h301h2h5h30
Total----33h30

Implementation

The report is a 2 dimensional matrix. It can combine one or two tables. This still isn’t clear at all, how to automate, so let’s go through the examples above and see how we a user could create such reports.

1- Time sheet

Time startTypeDescriptionTime spent
9h00Consultation...1h
10h00ReadingResearched law concerning xyz2h
13h00TravelMet with client1h
14h00ConsultationTalked with client2h
16h00TravelWent back to office1h
17h00OtherReported my activities30m
Total------7h30

The user can select the fields from the "Follow-up" table, sort using the "time start" column, and filter using the Author’s Name/ID.

Another way to do it would be to select "Follow-up - Time Start" for the matrix line, then the other fields for the matrix columns. This is a lazy way to apply the sort on "time start".

Since I want to explain how 2D reporting works, let’s put it this way:

- Line:

  • Source: lcm_followup
  • Fields: date_start

- Columns:

  • Source: lcm_followup
  • Fields: type, description, date_end - date_start

2- Activity types

Author nameReadingInterviewTravelOtherTotal
Alice3h455h154h001h0014h00
Bob3h304h002h002h0011h30

- Line:

  • Source: lcm_author
  • Fields: ID, name_first, name_middle, name_last

- Columns:

  • Source: lcm_followup
  • Fields: foreach(followup_type) sum(date_end - date_start)

To implement this, we can add an "enum_type" on lcm_field to indicate the source of the enumeration. In this case, the source of the enumeration is the system keyword "followups". The above "Columns" therefore becomes:

The report then loops through the follow-up types and prints the sum.

It’s still a bit tricky to indicate that we want the sum, not the avg() or the count(). One possibility is to add a column in lcm_field for the "action" on the enum_type.

- Columns:

  • Source: lcm_followup
  • Fields: date_end - date_start with action "sum"

3- Monthly case overview by author

Author name#cases opened#cases closed#appeals
Alice541
Bob420

- Line:

  • Source: lcm_author
  • Fields: ID, name_first, name_middle, name_last

- Columns:

  • Source: lcm_followup
  • Fields: sum(type = ’open’), sum(type = ’closed’), sum(type = ’appeal’)

The problem with this is that it assumes that only one author has opened, closed or appealed the case.

4- Case activity for each stage

StageReadingInterviewTravelOtherTotal
Investigation1h10h2h1h14h
Pre-trial3h2h1h0h6h
Trial4h2h1h1h8h
Appeal2h0h301h2h5h30
Total----33h30

- Line:

  • Source: lcm_followup
  • Field: stage

- Columns:

  • Source: lcm_followup
  • Field: type with action sum()

Of course, the biggest mess is to join the tables correctly, filter, etc.

In fact, we should provide filters for specific tables. For example:

- If lcm_author is "line", then expect that the user will want to filter by some column of "lcm_author" (name, type of author, ...)

- If lcm_followup is "line" or "column", expect that the user will want to filter by "date_start" or "date_end". Or even, in more advanced reporting, to list activities grouped by month (but that’s a luxury, since running the report many times for different periods will do the same thing.

To send a message Private area Registering with the site xml ?