Document toolboxDocument toolbox

Not (not)

Description

You can apply this operation either as a Filter or Create field operation:

Filter

Returns only the rows where the values in a specified Boolean field are false.

Create field

Creates a Boolean field that returns the complement of the values in another Boolean field (the complement of true is false and vice versa).

How does it work in the search window?

Select Filter / Create field in the search window toolbar, then select the Not operation. This operation requires only one argument:

Argument

Data type

Argument

Data type

Operand mandatory

boolean

If you use the Create field operation, the data type of the values in the new field is boolean (true or false).

Example

Following the example in the And operation, we want to get the logical complements of the boolean values we got using the And operation. Copy this query in the query editor to try the example below:

from demo.ecommerce.data select timeTaken > 200 as `timeTaken>200`, bytesTransferred > 1000 as `bytesTransferred>1000`, `timeTaken>200` and `bytesTransferred>1000` as `time>200&bytes>1000`

Now, create a new field using the Not operation and add the time>200&bytes>1000 field as argument. Let's call the new field logical compliment.

Click Create field.

Click Filter and follow the same steps to filter only the rows that show false in the time>200&bytes>1000 field.

How does it work in LINQ?

Use the operator where...  to apply the Filter operation and select... as...  to apply the Create field operation. This is the syntax for the Not operation:

  • not boolean

Examples

You can copy the following LINQ script and try the above example on the demo.ecommerce.data table:

from demo.ecommerce.data select timeTaken > 200 as `timeTaken>200`, bytesTransferred > 1000 as `bytesTransferred>1000`, `timeTaken>200` and `bytesTransferred>1000` as `time>200&bytes>1000` select not `time>200&bytes>1000` as logicalCompliment

And this is the same example using the Filter operation:

from demo.ecommerce.data select timeTaken > 200 as `timeTaken>200`, bytesTransferred > 1000 as `bytesTransferred>1000`, `timeTaken>200` and `bytesTransferred>1000` as `time>200&bytes>1000` where not `time>200&bytes>1000`