Difference between revisions of "Creating Summary Reports"

From SmartWiki
Jump to: navigation, search
(Using the Count Option)
(Using the Count Option)
Line 51: Line 51:
  
 
[[Image:Reps65.png]]
 
[[Image:Reps65.png]]
 +
 +
When you use '''Group By''', the results are sorted automatically in '''ascending''' sequence.
  
 
==Sorting Totals==
 
==Sorting Totals==

Revision as of 15:36, 30 November 2007

Overview

All the reports that you have created so far have displayed each record from the table that matched the criteria.

In many instances, you will not wish to display individual records, but instead summarize the records by grouping by some value and perhaps displaying a sum of a numeric value, or a count of the records that match each group you have established.

1. Create a new report named Employees by Department based on the user table.

2. Add Users – Company Name and Users – Last name fields.

3. Set the Column Headings as shown below:

Reps61.png

4. Build, save, and preview the report.

The report displays the department and the employee last name.

Reps62.png

5. Close the report and display the Report Builder.

Using Group By

You use the Group By row to specify the type of totaling that you require for each column.

Reps63.png

The options available in this combo box are as follows:

  • Group By - Groups the selected records by that column. You will usually use this option in addition to one of the other options applied to other fields.
  • Sum - Total of a numeric field.
  • Min - The smallest value in a field.
  • Max - The largest value in a field.
  • Count - A count of the number of occurrences.
  • Count Distinct - Count the number of distinct occurrences.
  • Average - The average of a numeric field.

Using the Count Option

1. Set the following Totals options:

Reps64.png

The records will be:

  • Grouped by Department – each department will only be shown once in the report.
  • Count of the Last Name – the count of employees in each department is displayed in the second column.

2. Build, save, and preview the report.

Reps65.png

When you use Group By, the results are sorted automatically in ascending sequence.

Sorting Totals

You can also apply sorting options to the report.

1. Modify the report to display the number of employees in descending order.

Reps66.png

The report will look as follows.

Reps67.png

Using Sum

Next you will copy the existing report and display the total salary for each department.

1. Copy the report Employees by Department to a new report Employees Total Salaries.

2. Modify the report as shown below:

Reps68.png

  • The Salary field has been added to the report and renamed – Salary.
  • The Group By Sum function is used to sum the salary for each department.
  • The report will sort descending from the department with the highest total salary.

3. Build, save, and preview the report.

Reps69.png

Using Average

The average function will calculate the average for each group.

1. Modify the Salary field to the report and add the Average function.

Reps70.png

2. Build, save, and preview the report.

Reps71.png

You can use the same field multiple times. For example, if you wished to show the total salary AND the average salary in two columns.

Setting a Criteria in a Summary Report

You can also set criteria in this type of report, in the same way that you set criteria in a regular report.

1. Modify the report as shown below:

Reps72.png

The report will now only display records where the average salary in the department is greater than or equal to 75000.

2. Build, save, and preview the report.

Reps73.png

Only two records are displayed that match this criteria.