Hello! Attempting to use the “QUALIFY” sql statement (working with Snowflake), I found pretty tricky but elegant solution to use that:
- Declare a measure with partition by in “sql”
- In an explore use sql_always_having attribute with the bare condition (1=1) and then write the “QUALIFY” keyword along with the conditions required.
measure: my_mes {
type: number
sql: SUM(${mes}) OVER (PARTITION BY ${my_dim}) ;;
}
------------ explore ------------
sql_always_having: 1=1
QUALIFY
${my_mes} >= 100000000
;;