> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/analyzer-external-javascript-api/using-pentaho-analyzer-external-javascript-api-cp/analyzer-filters-pentaho-analyzer-external-javascript-api.md).

# Analyzer Filters

Filters are used to restrict or limit data in a report, building the report to show only the information you want to view.

## Filter Type Levels

Within each dimension, you can have String, Date, and Numeric level filters.

The following type levels are supported:

* **String Levels**
  * Include and Exclude
  * Contains and Does Not Contain
* **Date Levels**
  * Include and Exclude
  * Before, After, and Between
  * All relative time filters such as 'Current Year' or '3 Years Ago'
* **Numeric Levels**
  * Include and Exclude
  * Contains and Does Not Contain
  * Greater Than (or Equals), Less Than (or Equals), and Between

The following operators are supported:

* `EQUAL`
* `NOT_EQUAL`
* `CONTAIN`
* `NOT_CONTAIN`
* `BEFORE`
* `AFTER`
* `BETWEEN`
* `TIME_AGO`
* `TIME_AHEAD`
* `TIME_YAGO`
* `TIME_RANGE_PREV`
* `TIME_RANGE_NEXT`
* `NUMERIC_LESS_THAN`
* `NUMERIC_GREATER_THAN`
* `NUMERIC_LESS_THAN_EQUAL`
* `NUMERIC_GREATER_THAN_EQUAL`
* `NUMERIC_BETWEEN`

## Filter Measure Values

Within each dimension, you can have Measure value filters.

The following Measure value types are supported:

* Top N
* Greater Than/Less Than filters

The following operators are supported:

* `LESS_THAN`
* `GREATER_THAN`
* `LESS_THAN_EQUAL`
* `GREATER_THAN_EQUAL`
* `EQUAL`
* `NOT_EQUAL`
* `BETWEEN`
* `IS_NOT_EMPTY`
* `TOP`
* `BOTTOM`
* `TOP_BOTTOM`

**Note:** The UI labels for these operators can be translated in the message.properties file. These labels appear in the filter dialog, filter summary and on the last page of exported reports

## Filter Logic

Each dimension is filtered independently and the results are logically AND'd together. Level filters are always applied before measure value filters and the two groups of filters are AND'd together. Within level filters, the following operators are OR'd together: Include, Contains, Before, After, Between and relative time filters. These filters are then AND'd together with the Exclude and Does Not Contain operators.

Here's a visual representation:

```javascript
(
  Include OR Contain OR Before OR After OR Between OR Any Time Filter
) AND (
  Exclude AND Not Contain
)

```

The above filters are then AND'd with any numeric filters:

```javascript
AND (Top 10 AND Greater Than)

```

Within a Contain or Not Contain operator, the individual expressions are OR'd together.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pentaho.com/analyzer-external-javascript-api/using-pentaho-analyzer-external-javascript-api-cp/analyzer-filters-pentaho-analyzer-external-javascript-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
