Last tested: May 2020
Most of these examples can be found in the filter expressions doc.
The most common filter syntax to filter out nulls is simply "-NULL"
. This works for most data types that aren't numbers, such as strings, dates, etc.
measure: count {
type: count
filters: {
field: user.status
value: "-NULL" # assuming that user.status is a string
}
}
For type number, use NOT NULL
instead.
measure: count {
type: count
filters: {
field: user.age
value: "NOT NULL" # assuming that user.age is a number
}
}
What if your string dimension literally has the string "NULL" in it? (As opposed to a real null (Ø)) Then you'll use this special syntax:
measure: count {
type: count
filters: {
field: user.status
value: "-'NULL'" # assuming that user.status is a string that actually has 'NULL" as a value
}
}
This content is subject to limited support.
Not working anymore
Not working anymore
Still working fine. Go away Tableau people!
Can you clarify how I would write an expression for custom filter to exclude null numbers?
When I use either ‘${field} NOT NULL’ or ‘${field} “NOT NULL”’, I get an error stating “expression incomplete”.