Edit a Logical Expression

You can modify the logical expressions that join filters in a report.

When you add multiple fixed or runtime filters at the same level in a report, the filters are automatically joined together with a logical expression. This defines how the filters should work together to return data. By default, the logical expression uses Boolean AND logic rather than OR logic. If you have a filter of incidents.status_id = Solved and a filter of incidents.queue_id = Queue A, the logical expression is incidents.status_id = Solved AND incidents.queue_id = Queue A.This expression would result in the report returning only solved incidents that are in Queue A.

If the default logical expression does not suit your needs, you can modify the expression from the Edit Logical Expression window. You can also delete, edit, and add filters from this window if you decide your existing filters need to be changed while editing the logical expression. Report filters, level filters, and group filters are joined with separate logical expressions, though each expression is edited in the same manner.

  1. Open the report you want to edit.
  2. Open the Edit Logical Expression window for the report filters, level filters, or group filters, depending on the type of filters you want to change the expression for.
    • To open the Edit Logical Expression window for report filters, click Filters on the ribbon’s Home tab.

    • To open the Edit Logical Expression window for level filters or group filters, select the report level you want from the Level drop-down list at the top of the design surface. Click the Level tab and then click the Level Filters or Group Filters button.

    When you add filters, they're automatically joined with AND logic and display in an AND tree. runtime selectable filters are displayed in the tree along with fixed filters, which have an icon displaying a lock.

  3. To add a filter joined with OR logic to the logical expression.
    1. Click Add OR Node.

      The node is added to the logical expression.

    2. Click the filter that should be joined with OR logic and drag it to the new OR node.

    When you add nodes to the expression, the nodes are displayed in a tree structure, with filters displayed either in an AND node or an OR node. Filters in the same AND node are joined to each other using AND logic. Filters in the same OR node are joined to each other using OR logic.

  4. To negate a filter, select the filter and click Negate Filter. To negate a node in the expression, select the node and click Negate Expression.

    A negated filter or node displays on the Edit Logical Expression window with an exclamation mark. Negated filters and nodes add NOT logic to the filter. For example, if your filter is incidents.status_id=Solved and you negate the filter, the filter becomes incidents.status_id NOT=Solved.

  5. To add a new filter, select the node you want to add the filter to and click Add Filter. See Create a Fixed or Runtime Selectable Filter.
  6. To edit a filter, select the filter you want to edit and click Edit Filter. See Create a Fixed or Runtime Selectable Filter for information about editing filters.
  7. To delete a filter, select the filter you want to remove and click Delete Filter.
    Note: If the filter you delete uses a table that is no longer needed in the report, you should remove the table from the report to help the report run efficiently. See Change Table Joins and Linked Fields.
  8. To display the filters’ field definitions rather than their names, click Display Filter Descriptions.
    The Edit Logical Expression window is updated to display the filters’ definitions. To display the filters’ names again, click Display Filter Names.
  9. To view a text definition of the current filters’ logical expression, click View Text Definition.
  10. Click OK.
  11. Click OK.
  12. Click Save.