Applying Filters

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 Filters tab at the bottom.
  2. For this circulation statistics example, select Circulation table, Check Out Date/Time field and Year + Month in transform column,then click on Add Fields. We are going to filter on the checkout month.

    images/report/template-10.png
  3. Note that the default operator for the filter is Equal. It may be changed. Select Check Out Date/Time row. Click on ActionsChange Operator and select In list from the dropdown menu in the popup window. This operator allows you to select multiple months when running the report,thus counting circulations done within each month for several months by just one report.

    images/report/template-11.png
    images/report/template-12.png
  4. To filter on the location of the circulation, select Circulation table, Circulating Library field and Raw Data transform, and click on Add Fields.

    Note that this is a template, so the value for this filter may be filled out when you run the report.

    For multi-branch libraries, you may want to change the operator to In List so that you could specify multiple branches when you run the report.

  5. 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 ActionsChange Column Documentation to 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.

    images/report/template-13.png
  6. Once you have configured your template, you must name and save it. Name this template Circulations by Months. You also need to add a description, otherwise the template can not be saved. Click Save Template.
  7. You will get a confirmation dialogue box that the template was successfully saved. Click OK/Continue.

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 find out the exact cause of the issue. After you have the desired template, you may delete all the interim ones.

The above paragraphs 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 32, Shared 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-2018, BC Libraries Cooperative