---
title: "Cascade Filters v3.2.0.1"
canonical: "https://servicedesk.maxgeo.com/space/DS/1749024845/Cascade%20Filters%20v3.2.0.1"
format: markdown
---
## Cascade Filters Concepts

DataShed5 allows users to create Cascade Filters to limit the data returned in DataShed5 by excluding any data that does not fit the criteria defined in the filter.

A Cascade Filter is created on the primary table of the filter type and when applied will filter data in all related tables for example a DownHole Cascade Filter is applied to tblDHColl and then filters all tables/views with the prefix tblDH or tblVWDH.

Filters can be saved with a user-defined filter name and activated and deactivated as required. The filter builder has ‘basic’ and ‘advanced’ modes, allowing for very complex filters to be defined.

Activating a filter will affect the data displayed in the Map displays, tables and views in ‘View Data’, downloads, and reports. Filters work in conjunction with the currently active DataSet Selection, as defined in the DataSet Manager.

Shared filters can be created by a user that is assigned the SysAdmin or User Plus Security levels.  Shared filters can be activated and deactivated by all users.  Shared Filters have a # prefix and can be edited and deleted by the SysAdmin and User Plus users.

## Create Filters

Selecting the Cascade Filters menu shows a selection of filter categories, from which new filters can be added. Clicking the ‘[+]’ button next to a filter category opens the filter editor, which allows the definition of the criteria for the filter.

![image](media://a52ebd67-cc8e-4321-bce7-c94b40597bd5)

The example below is based on the ‘DownHole’ category, filters based on other categories will have different column names available for filtering, but the method of building filters is the same.

To add a filter criterion, first select a column name, then choose a comparison method and select or enter a criteria value. In the example, the column ‘Max_Depth’ has been selected, the comparison method ‘greater than or equal to’, and the value is 100. When this filter is applied, it will limit the selection to only those holes that have a Max_Depth value of 100m or more.

Other comparison methods are available, including ‘equals’, ‘not equals’, ‘between’, ‘is null’, and more. Some of these require two criteria values instead of one (e.g. ‘between’) and some require none (e.g. ‘is null’). Entry fields for criteria values will appear as required. For some comparison methods, a list of currently available values is presented for selection.

![image](media://641d6b7e-e161-4e8b-8eb2-47c411e699a3)

After selecting the filter column, comparison method and relevant criteria values, click the ‘Add Criteria’ button to add the filter criteria to the filter definition. A description of the filter criteria appears in the ‘Basic SQL’ window.

![image](media://0b9e6402-c71f-4807-bebb-ab766634065a)

When displaying library table lists in the dropdown, the items can be distinguished between an in-active and active status. In-active items will be sorted to the bottom of the list and displayed using italic light grey font style.

![image](media://a265efb3-8774-40cf-aed7-03cedc3ca9d2)

Additional criteria can be added to the filter definition by repeating the process of selecting a column, choosing a comparison operator and entering the values as required, then clicking the ‘Add Criteria OR’  or ‘Add Criteria AND’  button. This adds the additional criteria to the filter with an ‘AND’ or an ‘OR’ operator.

Choosing ‘AND’ means that both criteria must be satisfied for records to be included in the result. Choosing ‘OR’ means the data matching either criteria will be included in the result.

Criteria can be removed by clicking the ‘X’ at the right side of criteria entry.

The image below shows a filter with multiple criteria conditions added to the filter definition.

![image](media://7ee0379e-8e23-4696-91fc-3277deffcf1a)

> ⚠️ Caution - adding multiple conditions with a combination of **AND** and **OR** may not behave the way that you expect. The **AND** conditions will be processed before the **OR** conditions.

Consider a filter with the following conditions:

	[Max_Depth] IS GREATER THAN OR EQUAL TO 100

	AND [Hole_Type] EQUALS ‘DD’

	OR [Hole_Type] EQUALS ‘DD_W’

The AND operation has a higher priority than OR, so is done first. This means that the filter will find type ‘DD’ holes that have a depth over 100m, and it will also include ‘DD_W’ holes *regardless of the depth*. The ‘AND’ will link the hole type ‘DD’ to the 100m+ holes, and this combined criteria is OR’d with the remaining criteria.

To have the filter find holes that are over 100m deep for both hole types ‘DD’ and ‘DD_W’, you need to use the Advanced Filtering function to edit the filter manually.

## Basic / Advanced Filtering

The ‘**Basic SQL**’ and ‘**Advanced SQL**’ buttons at the top right of the window will switch the criteria view between a simplified description of the criteria, and the ‘raw’ SQL text that will be applied to the database. Users with good understanding of SQL query syntax can edit the filter text directly in the Advanced View.

Using the example given above, creating a filter to find holes that are over 100m deep for both hole types ‘DD’ and ‘DD_W’, the filter will be created with the criteria described above.  After hitting the ‘Advanced SQL’ button the criteria is re-written in the compact form below:

![image](media://a723428b-0e63-4c06-aff8-c94c0d3d1a10)

The filter can be modified to provide the correct behavior by adding brackets – add a ‘(’ after the word ‘AND’, and a ‘)’ at the end of the statement. The brackets force the two hole type criteria to be grouped together before the depth restriction is added to the filter.

(tblDHColl.[Max_Depth] >= ‘100’) AND <span style="color: #ff5630">**(**</span> (tblDHColl.[Hole_Type] = ‘DD’) OR tblDHColl.[Hole_Type] = ‘DD_W’)<span style="color: #ff5630"> </span><span style="color: #ff5630">**)**</span>

Note that editing the filter criteria in the Advanced SQL view will mean that the filter criteria can no longer be modified using the Basic method.

## Shared Filters

A filter can be created as a ‘Shared Filter’ by a user that has “Sys Admin” or “User Plus” security level.  The option to create a Shared Filter will be available to these users as below.

![image](media://b58c2018-4688-471a-9392-8e70fa9a4c96)

Selecting the ‘Shared Filter’ check box and activating the filter will be available to all users.  Users that have a security level of “User” have the ability to activate and deactivate shared filters.  A shared filter will be created with a name starting with the # character.

![image](media://3165ef20-10df-4c93-b40c-ee6a6ed04b7c)

In the View Data section, when a cascade filter is applied, you'll notice a subtle yet effective visual cue: the table name on the header turns green. This **colour** change serves as a clear indicator that a cascade filter is currently active. **Simply** hover your mouse cursor over the green table name, and a pop-up will appear, detailing the specifics of the applied cascade **filter.**

![image](media://9466c254-9ad9-4a26-af8b-14cddd0163db)

## Activating / Deactivating Filters

All filters defined for the current user are shown in the Cascade Filters menu. Each filter is listed underneath the table for which it was originally created, showing the name of the filter or ‘unnamed filter’ or ‘map filter’ as appropriate.

Filters are shown with green text when active. Clicking the enable/disable filter icon will activate the filter, or de-activate the filter. Note that activating a filter will also de-activate any other currently active filters.

![image](media://faee7f78-91e6-4a64-869c-a4ddfcea10a0)

Activate Filter

![image](media://0141b19a-eae2-4212-9f34-e13593f16eea)

 Disable Filter

## Copying / Editing / Deleting Filters

The filter list will display copy / edit / delete options alongside each filter.

A user can copy an existing filter with the exception of unnamed filters by selecting the **Copy** icon. The filter editor will open with the copied filter criteria showing and the filter name with an *_Copy* suffix.

![image](media://671e3ab0-8653-4bd8-862f-9919a74cb47a)

A user can edit a filter by selecting the **Edit **option. The filter editor will open with the filter criteria showing.

![image](media://bfc24229-b25c-476d-9c2f-6a0b8a4a62de)

A user can delete a filter by selecting the **Delete** option. A confirmation prompt will display to confirm the deletion of the filter.

![image](media://fa5c54dc-3a8e-43f2-aa19-ae51d003eee2)

## Map Filters

Map filters can be created when any map is open (see ‘View Map’ section). Map filters are created by clicking the ‘Select multiple points by rectangle’  button on the map, then using the mouse click/drag to select a region. All active objects within the selected region are included in the new map filter. Note that object types that have been de-selected in the map layers selector are NOT included in the map filter.

![image](media://c6606194-aef0-4591-b467-b2fe2eb5b61a)

The new filter is shown in the cascade filters list as ‘Map Filter’ and is marked as active. Note that disabling the map filter will remove it. The ‘Remove active map filter’ button   will also disable/remove the map filter.

The ‘Display selected points’ button   shows a pop-up box containing a list of the points that have been selected by the currently active map filter. The separate pages of the list can be viewed using the page buttons at the bottom of the window. Search for items containing a particular group of characters by using the ‘Search’ window. Clicking the ‘Delete’ link next to a particular point will remove that point from the Map Filter selection, is does NOT remove the point from the database. Map Filter List popup can be moved, so user can still see map points underneath.

![image-20250630-065714.png](media://a9c65bb8-9d20-4224-a653-a834d18030ea)

Just like other Cascade Filters, active Map Filters will filter the data that is returned from ‘View Data’ and ‘Download Data’ activities.