0
Working with Filters
0

What Is a Filter?

Filters are used to restrict (limit) the data that is presented in a report. Let's look at some examples of reports with the data limited by a variety of filters.

Example 1: This report shows sales by product line. The filter on Quarter restricts the data so that only sales for the 4th quarter in 2006 are shown.

Example 2: If we add a regional filter of Europe, then the report only displays data pertaining to European sales in the 4th quarter of 2006.

Example 3: We can also add a filter on a field that is displayed in the report. If we add a filter on the Product Line field to exclude Surfing, then the report only displays data pertaining to European sales in the 4th quarter of 2006 that are not in the surfing product line.

About Pentaho Filters

Pentaho Analyzer offers the following options for filtering reports:

  • Filtering Level Fields: Level fields contain non-numeric information, so you can choose to include or exclude certain values at will. Time Periods, Names, Types, and Categories are examples of Level field groups; Product Line is an example of a specific level field.
  • Filtering Measure Fields: Measure fields include numeric information. Sales Revenue is an example of a measure field. You can create a numeric filter using Greater/Less Than or Top Ten.

Level Field Filters

The dialog box for filters on level fields lets you choose between two types of filters:

  • Selecting from a list of values. Analyzer will display a list of values, and you choose to include or exclude certain values
  • Match part of a string. You type in part of the name (string) that the name Contains or Does not Contain

Note: Typically, the list of possible values contains all available values although sometimes the list is narrowed down due to a filter on another field that is part of the same field hierarchy. (See About Field Hierarchies). This makes it easier for you to browse only values that are relevant. For example, if you have the filter Year=2006, then the filter dialog for Quarters will only contain four checkboxes - the four quarters for 2006.

When you filter on time periods you have three options:

  • Commonly Used Time Periods . Analyzer will display common time periods. A great thing about these pre-set choices are that they dynamically change as time goes by so if you set "current quarter" you don't have to change your filter every new quarter.
  • Select a range. Lets you define a range.
  • Select from a list. Use this option when the other options are not sufficient. Here you can choose to include or exclude any time period.

Measure Filters

You can restrict report data by applying conditions (e.g. Show me all product lines with sales revenue greater than 500) to measure fields. There are two flavors of the numeric filter:

  • Greater/Less Than...
  • Top 10, etc...
  • If your numeric filter has both a Greater Than and a Top Ten component at the same time, the Greater Than component is applied before the Top Ten component.
  • You can have only one numeric filter on a report at any given time.
  • When the report is generated, the numeric filter is applied after other filters are applied.

When you create a numeric filter, you specify:

  • One or more measure fields. You cannot select a calculated field (such as % of, Rank, Running Sum, etc.).
  • One level field, which indicates the values the numeric filter will filter. Note: If you remove the level field from the report later, the numeric filter also is removed.

Example 1: The following report shows sales by region and product line without a numeric filter:

image 7

Example 2: Now let's filter the report to show only data where sales revenue is above $12 for each product line. The filter removes any product lines that do not meet that criteria. Also note that the filter acts on sales for 2006 Q4 (as opposed to sales for all time periods).

Compare this to a filter that applies to each Region. The filter below removes regions.

image 8

Viewing and Editing Filters

To view the filters that are applied to a report, click the Show Filters button to display the Filters pane.

To edit an existing filter, click the Edit filter symbol next to the filter in the Filters pane.

Adding a Filter

A filter always acts on a field, so the first step is always to select a field. To add a new filter, use one of the following methods:

  • Method 1: Click on a field in the report, and select Filter from the menu. (This method assumes you use the field in the report).
  • Method 2: From the Available Fields pane, find the field you want to filter and drag the field into the Filters pane OR to the "(+) 0 Filter in Use" area.
  • Method 3: In the Available Fields pane, find the field you want to filter and right click on the field, and select Filter.

How Filters Work Together

Filters are applied in the following order:

  1. Level field filters, such as Product Line = Snow Sports or Time Period = 2006 Q4. (Note that the order between these filters is irrelevant.)
  2. Greater/Less Than component of numeric filters. This filter will further restrict the data.
  3. Top Ten component of numeric filters. This filter will even further restrict the data.

Another way to express this is: All level field filters are applied first (#1) creating a first "invisible" version of the report. Second, Greater/Less than filters are applied on this invisible report (#2), and -- finally -- based on this report, the Top 10 filter is applied (#3).

When Your Report Does Not Display Any Data

Please refer to the section When your Report Does Not Display Any_Data in the Fields chapter.

Related Topics