Filter

../_images/filternodeicon.png

Filter Node Icon

The Clario Filter node allows you to select rows from an input data stream based on specific selection criteria. The node connector can be connected to a variety of nodes, (e.g. Read File, Aggregate, Append, Missing, etc.), but requires a valid stream of data.

Configuration

The Filter node has only one configuration tab.

Configuration Tab

../_images/filterconfig.png

Configuration

To edit the selection criteria you can either: click [Edit Filter] to open the Filter Builder or click [Edit Code] to open the Filter Code Editor.

Filter Builder

The upper right view contains filter code. This view is read only, to edit it directly open the Filter Code Editor. The code view is highlighted based on the contents of the main work area. It also displays any errors in red, giving you a better indication where the error exists.

The center of the screen contains [Home] and [Back] buttons, to assist in navigation in and out of nested functions. Below the [Home] and [Back] buttons is the main work area, where functions, attributes, and constants will be placed. When finished adding code to the main work area, click [Save] (bottom right) to save and exit to the Filter Configuration tab. Or, click [Cancel] to exit without saving.

The far left box contains three tabs located at the top of the box:

  1. Functions f(x) - coding tools to perform a variety of functions (see table below) that are offered in the Filter node.
  2. Attributes list [att] - attributes from the data stream that are available to be used in the attribute creation/transformation process.
  3. Constants [cons] - to use as inputs to functions.

Select a function, attribute, or constant, then drag and drop it into the main work area. See tips on Finding and Selecting Attributes.

../_images/filterbuilder.png

Filter Builder

See what Functions, Operators, and Constants can be used in the Filter node.

Filter Code Editor

The code editor is an advanced feature giving you the ability to create a Filter with code instead of the builder. Once you’ve entered your code, click [Check] to verify it is syntactically correct. Any syntax errors that exist are displayed in the Messages window. Your code must be syntactically valid in order to save. In addition to syntax verification, the check operation will validate your Filter code, displaying any validation errors in the Message window. Unlike syntax errors, it is OK to save an invalid Filter just like you can in the builder. Refer to the complete coding guide for more information.

../_images/filtercodeeditor.png

Filter Code Editor

Filter Examples

Initially the Filter window is empty. To construct a filter, click the [Edit Filter] button in the bottom center of the Filter window. This will take you to the Filter Builder.

../_images/filterbuilderempty.png

Empty Filter

Inequality

The following is an example of how to build a filter based on an inequality expression:

  1. On the left side of the Filter Builder window, click the [att] tab to view a list of available attributes. Drag and drop an attribute that is a number into the main work area.
../_images/filterblankworkarea.png

Blank work area

../_images/filteroneattribute.png

One attribute

  1. Next add a numerical constant to the work area. To do this, click on the cons tab on the left side of the Filter Builder window, drag and drop ‘Number’ into the main work area below the attribute.
  2. Define a number by typing a value directly into the ‘Number’ field. Constant numbers default to 0.
../_images/filteroneattrpluscons.png

Attribute and a constant

  1. Change the operator connecting the attribute and the constant. The default operator is addition (+). Change the operator to an inequality (greater than, greater than or equal to, less than, less than or equal to). To change the operators, simply click on the operator dropdown between each attribute (see Figure), and select an inequality operator.
  1. Once the inequality is complete, click Save.

Attributes (and constants) can be dropped above or below existing attributes on the work area. Once on the main work area, items can also be re-ordered by dragging and dropping them above or below existing items. Furthermore, items can be move to within a function parameter by moving the item on top of the function parameter box. To ensure that the item will go within the function, wait until the function box turns green. If there are errors within the filter equation, the filter box will be highlighted in red. If you hold the mouse over the box, an informative error message will appear.

../_images/filterinequalitycomplete.png

Inequality complete

Logical Operators and Sqrt

Below is a more complicated example of a Filter that uses logical operators and the Sqrt function.

../_images/filtermorecompex.png

More complicated Filter

Results

See the Filter Node Results.

Output Stream

The newly filtered dataset is ready for immediate use in other nodes to explore, manipulate, cleanse, and model the data. The data can be exported at any point in a workflow by using Write File node.

Table Of Contents

Previous topic

Factor

Next topic

Join