5.5.7. Filter Rows (High-Speed clip0090 action)

<< Click to Display Table of Contents >>

Navigation:  5. Detailed description of the Actions > 5.5. Standard >

5.5.7. Filter Rows (High-Speed clip0090 action)

 

Icon: ANATEL~3_img473

 

Property window:

 

ANATEL~3_img474

 

Short description:

Filters rows.

 

Long Description:

This operator filters the row of the input table.

The first output pin contains all the rows that match the given test.

The second output pin contains the non-matching rows.

 

For example: If we want to select all the people with an age above 25, we’ll have:

 

The expressions given insideANATEL~3_img473FilterRows Action follows the same syntax as the expressions from the clip0163Calculator Action: Please refer to the previous section about the clip0163Calculator Action for more information about the usage of the TheANATEL~3_img473FilterRows Action.

 

One very common usage of the ANATEL~3_img473FilterRows Action is to use it to create a sample. Samples are very useful to reduce the computing-time when developing a new script: We develop new data-transformation-graphs on small samples and, once they are working ok, we run the data-transformation-graphs on the whole dataset. For example: If we want to select the first 100 rows of the input table:

 

ANATEL~3_img480

 

(The variable “_n” is the “row number”). Please note that we checked the option “Truncate table on first failed row”: number1  When this option is checked, Anatella will stop reading the input table at the first row where the expression value is false. When this option is active, the 2 expressions “_n<100” and “(_n<100)||(_n>200)” will both select only the first 100 rows of the input table. The main objective of this option is to “give a hint” to Anatella in order to reduce the computing time (we can safely check this option when evaluating the expression “_n< 100”, because it’s totally useless to read more than the first 100 rows).

 

 

ANATEL~2_img8

When the “Truncate table on first failed row” option is enabled the table on the second output pin of the ANATEL~3_img473 rowFilter Action is always empty.

 
 

ANATEL~2_img8

When the expression is “_n< [number]”, then Anatella automatically checks/enables for you the “Truncate table on first failed row” option (because 99% of the time, this is what you really want, even if you forgot to check it).

This also means that, when the expression is “_n< [number]”, you’ll always obtain an empty table table on the second output pin of the ANATEL~3_img473 rowFilter Action. If you want a non-empty table on the second pin, re-write you expression in the following way: “[number]>_n”.