Complex Filters

Filters that are part of a report provide a limited capability when it comes to expressions that refer to report hierarchies.  It is possible to extend the filters in your report to allow general references to hierarchies.  These may or may not be part of the current report selections.

Compound Report Filters

A compound filter group contains filters at a hierarchy level other than the hierarchy level(s) associated with the hierarchies currently selected for the fields in the report.  This extends the current filter groups available for reports.  For example, a single-hierarchy report with a hierarchy titled My Hierarchy currently may have filters referring to the hierarchy titled My Hierarchy.  With compound query filters, the report may have filters referencing hierarchies other than My Hierarchy.

As another example, a report without any hierarchies may have compound filters that reference any accessible hierarchy.  This report does not display its output in a hierarchal format just because it contains hierarchy filters.

Filter Data Structures

The data structures that affect filter access are:

  1. Filter groups - these are collections of filters associated with a report
  2. Report layouts - these are the layouts containing the field selections and hierarchy levels for a report
  3. Filter - these are the objects containing the conjunction, field name, operator, and hierarchy level

In a non-hierarchical report, there is a single filter group, a single report layout, and the filters do not have a hierarchy level (more accurately the hierarchy level is zero).

In a single-level hierarchy report - typically a parent-child type report - there is one filter group, one report layout for each level of the hierarchy, and the filters each refer to the level within the hierarchy.

In a multi-hierarchy report, the single filter group consists of a collection of filters for each hierarchy level. The filter collections are grouped by their hierarchy level.  For the first hierarchy, there may be filters at the top level.  These top-level filters are propagated to all other hierarchies before the report is run. Filters in the hierarchies after the first may NOT have hierarchy top level filters specified

User Interface within the Report Editors

The user interface for defining compound filters in a report is similar to that used for multi-hierarchy reports.  There is a Compound Filter checkbox that enables the feature and allows compound hierarchy filters to be defined on the screen.

The resulting filter group from the GUI shall be generated as follows:

  1. Each filter may have its own hierarchy level
  2. No field selection is necessary for compound hierarchy levels
  3. For each filter hierarchy, the filters for that hierarchy are ordered by their position on the report editor screen, from top to bottom
  4. The hierarchy level for a compound filter may be any level in the associated hierarchy, including the top level.