not equals
The not equals (!=
) match filter returns rows that do not exactly match the specified value.
Syntax
columnName != value
columnName
- the column the filter will search for non-matching values.value
- the value to match on.
Examples
The following example returns rows where Color
is not blue
.
source = newTable(
stringCol("Letter", "A", "C", "F", "B", "E", "D", "A"),
intCol("Number", NULL_INT, 2, 1, NULL_INT, 4, 5, 3),
stringCol("Color", "red", "blue", "orange", "purple", "yellow", "pink", "blue"),
intCol("Code", 12, 13, 11, NULL_INT, 16, 14, NULL_INT),
)
result = source.where("Color != `blue`")
The following example returns rows where Color
is not blue
and Code
is not 14.
source = newTable(
stringCol("Letter", "A", "C", "F", "B", "E", "D", "A"),
intCol("Number", NULL_INT, 2, 1, NULL_INT, 4, 5, 3),
stringCol("Color", "red", "blue", "orange", "purple", "yellow", "pink", "blue"),
intCol("Code", 12, 14, 11, NULL_INT, 16, 14, NULL_INT),
)
result = source.where("Color != `blue`", "Code != 14" )
The following example returns rows where Color
is not blue
or Code
is not 14.
import io.deephaven.api.filter.FilterOr
import io.deephaven.api.filter.Filter
source = newTable(
stringCol("Letter", "A", "C", "F", "B", "E", "D", "A"),
intCol("Number", NULL_INT, 2, 1, NULL_INT, 4, 5, 3),
stringCol("Color", "red", "blue", "orange", "purple", "yellow", "pink", "blue"),
intCol("Code", 12, 14, 11, NULL_INT, 16, 14, NULL_INT),
)
result = source.where(FilterOr.of(Filter.from("Color != `blue`", "Code != 14")))