Pre-filtering Data in the Data Manager
Setting Pre-filters allows you to select a subset of cases that satisfy a condition, before grouping, sorting or applying a formula to them.
There are several icons displayed in the pre-filter, which are useful to understand before applying filters:
The filter type icon: located at the left side of the Pre-filter area, it varies according to the filter type chosen. Possible options are:
And: used in filter conditions to specify that all filter conditions must be satisfied.
Or: used in filter conditions to specify that at least one filter condition must be satisfied.
Make persistent: located on the right side of the query panel. Click on it to effectively apply all the query operations and permanently change the dataset.
Clear: located on the right side of the query panel. Click on it to clear the query table, removing all the created query operations, performed since the last time Make persistent was selected, and their effects to the dataset.
Prerequisites
You must have created a flow;
You must have linked the Data Manager to a task which contains the data to work on.
Procedure
Select whether you want to satisfy all the conditions simultaneously (and) or only one of them (or). This choice can be made also after having set the attribute’s filters by clicking on the and/or button in the Pre-filter box.
Drag your attributes onto the Pre-filter area.
Set your pre-filter options, as described in the filter options table below.
Click Apply.
Click either:
Make persistent to save your results and make all the query operations permanent.
The pre-filter cell is automatically cleared from the query operations performed, but the query operations are still applied to the table.Clear to remove query operations from the query panel: it cancels all the query operations that haven’t yet been made persistent.
Save and Compute the task.
Filter by: | Details |
---|---|
Values | This option allows you to set conditions on the values of the selected attribute.
|
Attributes | This option allows you to filter your values based on its relationship with another attribute. You can filter values by selecting the operator you want to use to filter your data, then select the attribute from the drop-down list. For ordinal values you can also select a range by also specifying the left-hand operator. |
Code | This option allows you to filter your values via a custom formula. First select the required operator to filter your data, then enter the formula and open a bracket:
To specify a range of ordinal values, successively select a left-side operator and specify the required values in the same way. You can decide whether to consider the None values or not by clicking on the corresponding checkbox. To know which formulas can be used in the code filter go to the Formulas and Functions page. Remember that it is mandatory to follow the formula’s syntax (including capital letters), otherwise an error is returned. |
To view a configured filter, right-click the attribute in the pre-filter area and select Open.
To disable right-click the attribute in the pre-filter area and select Disable. If the filter is disabled, the attribute will result in a blurred image and the dataset won’t be filtered.
To re-enable the filter, right-click the attribute in the pre-filter area and select Enable - this is useful if you want to enable only the selected querying operation.To delete a filter, right-click the attribute in the pre-filter area and select Delete.
To build complex filters with the Indent Selection feature see the page Building complex pre-filters & post-filters in the Factory.
Operators available for ordered attributes
Operator | Meaning |
---|---|
== | Equal to |
!= | Not equal to |
< | Less than |
<= | Less than or equal to |
> | Greater than |
>= | Greater than or equal to |
Example 1 - Pre-filter - Values
The following example uses the Supermarket_sales dataset.
Step | Screenshot |
---|---|
| |
| |
This is the result after you have pre-filtered the dataset. All the values containing Home and lifestyle are shown. |
Example 2 - Pre-filter - Attributes
The following example uses the E-commerce shipping data dataset.
Step | Screenshot |
---|---|
| |
This is the final result after you have pre-filtered the Customer_care_calls attribute. |
Example 3 - Pre-filter - Code
This example uses the Adult dataset.
Step | Screenshot |
---|---|
| |
This is the final result after you have pre-filtered the age attribute. |