Skip to main content
Applies a filter to all rows in a query using SQL. This parameter is functionally identical to always_where_filters, but uses SQL instead of filter syntax. When defined, a filter will be inserted into the WHERE clause of the generated SQL block of all queries in the topic. Users with the Querier role can’t change this filter and it will be visible only in the underlying SQL of any queries. This filter is additive to any filters specified in the workbook. For optional filter conditions, use default_filters. This parameter is useful for removing invalid data from the topic, such as deleted records or internal testing. Conditions should be written using ${} syntax to reference fields defined in Omni.
You can generate a syntactically correct condition using the workbook:
  1. In a workbook, add the filter using the UI.
  2. Click the SQL button near the top-right corner of the page.
  3. Copy the content of the WHERE clause.
  4. Paste the contents into the always_where_sql parameter.

Syntax

always_where_sql: "<sql_condition>"

Properties

always_where_sql
string
A SQL condition that is applied to all queries in the topic. Use ${} syntax to reference fields defined in Omni (e.g., ${view_name.field_name}).

Examples

always_where_sql: ${order_items.sale_price} != 0