6.2.7 Using an Expression in a Condition
The test values of a filtering condition can be a SQL or a JavaScript expression. To filter a field in a data block based on an expression, follow these steps:
1. Open the Worksheet containing the data block you want to filter.

2. Click the 'Condition' button on the title bar of the data block you wish to filter. This opens the 'Condition' dialog box.
3. Select the field and the desired logical operator.
4. Click on the arrow button to choose 'Expression' from the menu.

5. Click the 'sql' or 'js' button at the left of the expression text field to choose the expression type.
Note: Use SQL expressions if possible. See SQL vs. JavaScript in Expressions.
6. Click on the 'Fx' button to launch the expression edit dialog and enter your expression.
For example, to retrieve orders placed before today, you can use one of the following conditions:
// SQL:
[Order Date] [is] [less than] [CURRENT_TIMESTAMP]
// JavaScript:
[Order Date] [is] [less than] [CALC.today()]
SQL vs. JavaScript in Expressions
Expressions that use SQL syntax are processed by the database, while expressions that use JavaScript syntax are post-processed by the Worksheet. Because post-processing is CPU-intensive for the query engine, and may additionally cause retrieval of a large amounts of raw data, it is preferable to use SQL syntax when possible. Note, however, that SQL functions are database-specific and vary from one database to another.
| << 6.2.6 Using a Field in a Condition | © 1996-2013 InetSoft Technology Corporation (v11.5) | 6.2.8 Using a Subquery in a Condition >> |