The core declaration of the field definition using SQL.
The core declaration of the field definition. Best practice dictates using field references over raw database columns when calling other fields/dimensions. Note that dimensions can only derived from other dimensions, unlike measures.
DO NOT PARSE is a special argument used to stop Omni’s parser from interpreting and validating the SQL. This should be used in the rare circumstance that Omni is not saving valid SQL in the model, which can happen when obscure, dialect-specific SQL is used.
A SQL expression that defines the dimension. If the SQL includes protected words (e.g., group), nclude them with the following syntax: "`group`"Field type is implicit in Omni, and defined based upon the underlying field’s database type. To change the type, CAST the field (for example, sql: ${zip_code}::string).
When referencing other fields, use Omni field references (${view.name}) instead of the raw database name. For example, ${orders.id}
is_special_date: sql: |- CASE WHEN ${orders.created_at[date]} >= '2022-04-14' AND ${orders.created_at[date]} <= '2022-05-09' THEN 'Mothers Day 2022' WHEN ${orders.created_at[date]} >= '2022-05-26' AND ${orders.created_at[date]} <= '2022-06-20' THEN 'Fathers Day 2022' ELSE 'Other' END
DO NOT PARSE usage
Copy
Ask AI
state_sentiment: sql: |- -- DO NOT PARSE SNOWFLAKE.CORTEX.SENTIMENT(${states.state})::float