Filters are a set of named criteria that allow you to display only specific records in a Report. Zoho Creator creates default filters for the fields belonging to any of the following types; these are called Auto filters.
- Dropdown and Radio fields
- Multi Select fields
- Lookup fields
- Date and Date-time fields
If your form contains any of the above given types of fields, the corresponding field names will be displayed in the GUI as shown below, when you select the Set Filters option for a report in Edit mode. For example, in the Employee details form, the field Department is a single-select lookup field. Hence, it is displayed as a default filter. You can enable/disable the auto filters using the show/Hide button. By default, it is disabled.
When you access the report, the filters will be displayed in the Filter list-box as shown below. The name of the field will be taken as the name of the filter. The values for the fields will get displayed in the Filters drop-down list. Selecting a filter name will display only those records that satisfy the filter's criteria. For example, if the Department is selected as Accounts, only those employees in the Accounts department will be listed.
- To sort the option in the filter list of a drop-down/lookup fields, set the option "Show choices in alphabetical order". The values will be displayed in alphabetical order in the filter list.
- Sorting a filter list for a date-time field is not yet supported.
- Date / Date-time filter list is sorted based on added time in ascending order and limits to 50 values.
Custom filters are a set of named criteria that can be defined by the user. To create a custom filter,
- Select the Reports from the Reports tab, in Edit mode.
- Go to Reports Settings -> Filters -> New Custom filter option in the Set Filters dialog.
- Specify the custom filter name and the condition based on which the records will be filtered.
- If you have specified more than one condition and the filter needs to match all the conditions, use the AND operator.
- If you have specified more than one condition and the filter needs to match any one condition, use the OR operator.
- In live mode, the custom filters will be listed under the filter icon, as shown in the screen shot below. Just click on the view name to select the required custom filter.
The custom filters configured in the GUI will be added to the report definition. To view the definition, select Report Settings -> Definition.
Lets say we need to fetch records of last few weeks from a Zoho Creator Report. For example, records from last 6 to 12 weeks. This can be achieved by adding a custom filter based on the subWeek() function. To add the filter,
- Select the Report from the Reports tab, in Edit mode.
- Go to Reports Settings -> Filters -> New Custom filter option in the Set Filters dialog and configure the custom filter as show in the image below:
The configured custom filter fetches and displays records from the last 6 to 12 weeks.