# Use Workbench Report Filters

When you run a _Workbench Report_, Vault uses the report filters to parse through records defined by the safety view and generate the output. 

Navigate to **Workbench > Ad Hoc Reports > [report]** and expand the _Filters_ section to make updates.

The main components of a filter are: 
* The filter field
* The operator 
* The filter value 

<a href="https://platform.veevavault.help/assets/images/saf-workbench-report-filters-annotated.png" data-lightbox="saf-workbench-report-filters-annotated.png" data-title="" data-alt="saf-workbench-report-filters-annotated">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-workbench-report-filters-annotated.png" alt="saf-workbench-report-filters-annotated" style="max-width: 80%;"  />
</a>

There are multiple types of _Workbench Report_ filters: 
* [Report-specific filters][1]: The filters you add to the _Workbench Report_. 
* [Inherited criteria and filters][2]: The criteria and filters inherited from the selected safety view and any other views dependent on this view. These fields appear in the _Criteria_ and _Filters_ subsections, respectively, of the _Filters_ section.

<a href="https://platform.veevavault.help/assets/images/saf-workbench-report-filters.png" data-lightbox="saf-workbench-report-filters.png" data-title="" data-alt="saf-workbench-report-filters">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-workbench-report-filters.png" alt="saf-workbench-report-filters" style=""  />
</a>

## How to Add Filters

You can add filters on the _Workbench Report_ in addition to any inherited filters. To add a filter to the report: 
1. In the _Filters_ section of the _Workbench Report_, select a field from the dropdown. Some fields require the use of <a href="/en/gr/936862/">_Dynamic Views_</a>. A single _Workbench Report_ can reference up to 15 _Dynamic Views_; this includes any filters you add and view columns you select in the <a href="/en/gr/752971/#select-layout-fields">_Layout_</a>.
2. Select an [operator][3] from the dropdown. 
3. Select a field value, if applicable.
4. (Optional) Add more filters by selecting the **Plus** (**+**) icon to the right. 
5. (Optional) Delete a filter by selecting the **Minus** (**-**) icon. 

The fields you can select in the _Filters_ section depend on the safety view you selected in the <a href="/en/gr/752963/#properties">_Properties_ section</a>. 

If you cannot select a field to filter on, contact your Admin as there may be a misconfiguration on the selected view.

For more information on _Workbench Views_ and _Principal Views_, and understanding _Workbench Report_ filtering logic, see <a href="/en/gr/752978/">Configure Safety Views in Safety Workbench</a>.

### Operators 

When Vault parses for data using filters, filter values are case-sensitive. The sections below describe filtering behavior for each operator. 

The operators available for selection on a filter depend on the filter's field type. Field types include the following:
* _Text_
* _Date_ and _DateTime_
* _Number_
* _Yes/No_
* _Object_
* _Picklist_
* _Multi-Value Picklist_
* _MedDRA_

#### Equals 

Returns results where all filter values are in the field. 

**Example filter**: (Field) _Case > Patient Initials_ (operator) _equals_ (value) _AD_

#### Is Not Equal To 

Returns results where the field does not contain any of the filter values. 

**Example filter**: (Field) _Case > Patient Initials_ (operator) _is not equal to_ (value) _AD_

#### Is Blank 

Returns results where the field contains no field value. 

**Example filter**: (Field) _Case > Study Arm_ (operator) _is blank_

#### Is Not Blank 

Returns results where the field contains a field value. 

**Example filter**: (Field) _Case > Study Arm_ (operator) _is not blank_

#### Starts With

For the _Text_ field type only, you can enter any value up to 50 characters. Vault returns results that start with this value.

**Example filter**: (Field) _Lot Number_ (operator) _starts with_ (value) _123abc_

#### Contains (Sensitive and Insensitive)

For the _Text_ field type only, you can enter any value up to 50 characters. Vault returns results that contain this value. You can select whether this filter value is case-sensitive or case-insensitive. 

**Example filters**: 
* (Field) _Lot Number_ (operator) _contains (sensitive)_ (value) _123abc_
* (Field) _Lot Number_ (operator) _contains (insensitive)_ (value) _123abc_

#### In

For the _Picklist_, _Multi-Value Picklist_, and _Object_ field types only. For multi-value picklists, the _in_ operator returns results that include at least one (1) of the filter values.

**Example filter**: (Field) _Case > Lifecycle State_ (operator) _in_ (value) _Open In Progress Complete_

#### Not In

For the _Picklist_, _Object_, and _MedDRA_ field types only, returns results that do not include the filter values. 

**Example filter**: (Field) _Case > Lifecycle State_ (operator) _not in_ (value) _Closed_

#### Is After

For the _Date_ and _DateTime_ field types only, returns results that succeed the filter value. 

**Example filter**: (Field) _Case > Event Onset (Normalized)_ (operator) _is after_ (value) _01 Apr 2024_

#### Is Before

For the _Date_ and _DateTime_ field types only, returns results that precede the filter value. 

**Example filter**: (Field) _Case > Event Onset (Normalized)_ (operator) _is before_ (value) _01 Apr 2024_

#### Is in the Range

For the _Date_ and _DateTime_ field types only, returns results that include date values that fall within the set date range.

#### Is Greater Than 

For the _Number_ field type only, returns results that are larger than the filter value. 

**Example filter**: (Field) _Case > Age_ (operator) _is greater than_ (value) _18_

#### Is Less Than

For the _Number_ field type only, returns results that are smaller than the filter value. 

**Example filter**: (Field) _Case > Age_ (operator) _is less than_ (value) _18_

#### Is Greater Than or Equal To

For the _Number_ field type only, returns results that are larger than or equal to the filter value. 

**Example filter**: (Field) _Case > Age_ (operator) _is greater than or equal to_ (value) _18_

#### Is Less Than or Equal To

For the _Number_ field type only, returns results that are smaller than or equal to the filter value. 

**Example filter**: (Field) _Case > Age_ (operator) _is less than or equal to_ (value) _18_

#### Relative Dates

Vault supports a number of filter operators that are relative to the current date for the _Date_ and _DateTime_ field types. For more information about relative filters and to see the complete list of supported relative date filter operators (with the exception of _Is in the last full_), see <a href="/en/gr/8591/#relative-filters">Using Report Filters</a>.

When <a href="/en/gr/860557/#run-all-reports">running a _Workbench Report_</a> that contains a filter with a relative operator, consider the following:
* For _is in the last_, _is in the next_, and _is not in the last_ operators:
    * A month is 30 days.
    * A year is 365 days.
* For all relative operators:
    * A start date starts at 00:00 (midnight) and an end date ends at 23:59:59.
    * The date and time is based on the following priority order:
      1. The <a href="/en/gr/752963/#advanced-options">_Timezone_</a> specified in the _Workbench Report_
      2. The _Timezone_ in the _User Profile_ of the user who configured the <a href="/en/gr/860557/#schedule-workbench-report-sets">schedule</a> that ran the _Workbench Report_

**Example**

A user configures a report to show completed cases for their product. They apply a filter to the report to show only cases in the last calendar month. If a user runs this report on August 2, Vault returns cases from July 1 to July 31; if a user runs this report on October 10, Vault returns cases from Sept 1 to Sept 30.

#### Equals Query

For the _MedDRA_ field type only, users can select a filter value from any standard MedDRA query (SMQ) or custom MedDRA query (CMQ). If the query contains higher level MedDRA terms, such as System Organ Class (SOC), the query will expand to the Lower Level Terms (LLTs) included within the SOC. These LLTs are matched against the _Event (LLT)_ field on _Case Adverse Events_ in your Safety Vault. Returned results include _Case Adverse Events_ that match any LLT within the expanded query.

**Example filter**: (Field) _Event (LLT)_ (operator) _equals query_ (value) [_Custom MedDRA Query_]

### Advanced Logic

Vault assigns advanced logic numbers to each filter, as displayed in the following image: 

<a href="https://platform.veevavault.help/assets/images/saf-advanced-logic-numbers.png" data-lightbox="saf-advanced-logic-numbers.png" data-title="" data-alt="saf-advanced-logic-numbers">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-advanced-logic-numbers.png" alt="saf-advanced-logic-numbers" style=""  />
</a>

While advanced logic is turned on, you can only remove the last filter. To remove other filters, select **Remove** to turn advanced logic off. 

For more information about adding advanced logic, see <a href="/en/gr/8591/#advanced-logic">Using Report Filters</a>. Vault's advanced logic limitations do not apply to the Safety Workbench application. Instead, consider the following advanced logic criteria: 
* All open brackets must have a close bracket.
* All advanced logic numbers must be present in the _Advanced Logic_ section.
* Only one (1) operator (AND or OR) is allowed within a single bracket level, for example, (1 OR (2 AND 3)).

## Inherited Criteria and Filters

Your Admin's configuration affects filters on _Workbench Reports_ in the following ways: 
* _Workbench Reports_ can inherit criteria and filters from the selected <a href="/en/gr/752978/">safety views</a> based on the following configuration:
    * <a href="/en/gr/752978/#workbench-view-parameters">_Workbench View Parameters_</a>: In the _Workbench Report_, criteria fields appear in the _Filters_ section under the _Criteria_ subsection. The criteria values that you enter in this section contribute to filtering the data set in the report output. For _Date_ and _DateTime_ filters, unless you specify a <a href="/en/gr/752963/#report-timezone">_Timezone_</a>, Vault defaults to UTC.
    * <a href="/en/gr/752981/#how-to-add-filters">Filters</a>: In the _Workbench Report_, filter fields appear in the _Filters_ section under the _Filters_ subsection.
    * <a href="/en/gr/752981/#set-the-available-on-report-editable--required-checkboxes">Depending on your Admin's configuration</a>, you may be able to leave the filter value blank on the _Workbench Report_. However, you cannot edit the filter field or operator.
* The selected safety view may be associated with several other <a href="/en/gr/752978/#dependent-views">dependent views</a>. Criteria and filters on these dependent views may also be available on the _Workbench Report_. 

The following information applies to inherited criteria and filters on _Workbench Reports_: 
* Inherited filters appear in groups and are separated by safety view. The following example is for inherited filters. The image below displays two (2) filter groups, each pertaining to a different safety view: 
    * _All Cases x All Events_
    * _All Cases x All Events > Latest Version_ \
    <a href="https://platform.veevavault.help/assets/images/saf-workbench-report-filter-groups.png" data-lightbox="saf-workbench-report-filter-groups.png" data-title="" data-alt="saf-workbench-report-filter-groups">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-workbench-report-filter-groups.png" alt="saf-workbench-report-filter-groups" style=""  />
</a>
* You cannot add or remove filters in a filter group inherited from safety views.
* Advanced logic is unavailable for inherited filters and does not apply to criteria fields. For more information, see <a href="/en/gr/752981/#advanced-logic">Add Safety View Filters in Safety Workbench</a>.

[1]: #how-to-add-filters
[2]: #inherited-criteria-and-filters
[3]: #operators
