28.2. Applying Filters

$Id: 96670403b5fe7a8ef4e760c51a0e59d21910f7ed $

Without filters, all records in the database will be in the result, which is seldom desired, especially in Sitka's context where libraries share the same database. So some filters should be applied to keep out the unwanted records.

The following procedure shows how to add filters to the example template:

  1. Select the Base Filters tab in the bottom Template Configuration pane.

  2. For this circulation statistics example, select Circulation Check Out Date/TimeYear + Month and click on Add Selected Fields. You are going to filter on the checkout month.

  3. Select Check Out Date/Time. Click on Change Operator and select In list from the dropdown menu. This operator allows you to count circulations done within each month for several months by just one report.

  4. To filter on the location of the circulation select Circulation Circulating library Raw Data and click on Add Selected Fields.

  5. Select Circulating Library and click on Change Operator and select Equals. Note that this is a template, so the value for Equals will be filled out when you run the report.

    For multi-branch libraries, you would select Circulating Library with In list as the operator, so you could specify multiple branch(es) when you run the report.

    Refer to Template Terminology for details of Transforms and Operators, and Aggregate and Non-aggregate filters.

  6. You may add a hint to the filter, e.g. explaining the function of the filter, what value is expected when setting up the report, etc. Select the filter and click Change Field Hint.

    In the above example, we added some instruction on how to fill up the filter when setting up the report. The hint will show up on the report creation screen. Below is how it looks like on the report creation screen.

  7. Once you have configured your template, you must name and save it. Name this template Circulations by month for one library. You can also add a description. In this example, the title is descriptive enough, so a description is not necessary. Click Save.

  8. Click OK.

  9. You will get a confirmation dialogue box that the template was successfully saved. Click OK.

Tip

The bottom right hand pane is also a source specifier. By selecting one of these rows you will limit the fields that are visible to the sources you have specified. This may help to find out the source of the fields, e.g. a circulating library is from the circulation table or item table. Use Ctrl+Click to select or deselect items.

Once a template is saved, it can not be edited anymore. To make changes you will need to clone it and edit the clone. This will ensure that the work you have done will not be lost. As mentioned before, creating a template is complex. The first try seldom gets the perfect result. Your subsequent changes may not always improve the result. You may need to refer back to your old version. Make changes step-by-step. Check the correctness of the result on each step. This may help you to find out the exact cause of the issue. After you have the desired template, you may delete all the interim ones.

The above paragaphs described how to create a template from scratch with a very simple example. You may choose instead to use one of the generic templates created by the Sitka team to meet common reporting needs (see Chapter 33, Shared Templates in SITKA_templates). However, knowing how a template is created will help you understand the report structure and is recommended as an introduction to editing template fields and filters.

Copyright © 2008-2012, BC Libraries Cooperative