NOT IN of SQL in LOOKER

Hello everyone, I would like to know if I can use SQL NOT IN in Looker in a dimension.

Example: sql: ${TABLE}.ID NOT IN ('123');;

I would like to not bring some IDs when creating some looks through explore

0 1 734
1 REPLY 1

Do you always want to exclude those IDs from the explore? 

If so, I would use sql_always_where parameter for an explore

explore: name {
sql_always_where: ${name.id} NOT IN(123,12312,312) ;;
}

https://docs.looker.com/reference/explore-params/sql_always_where

If you want to choose whether to include them or not in specific looks/explorations, Just create a yesno field

filter: is_excluded {
type: yesno
sql: ${id} NOT IN (12,3125,561) ;;
}

Then you can use it whenever needed

Top Labels in this Space
Top Solution Authors