Document toolboxDocument toolbox

Not (not)

Description

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

Filter

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

Create column

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

How does it work in the search window?

Select Filter / Create column 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 column operation, the data type of the values in the new column 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 column using the Not operation and add the time>200&bytes>1000 column as argument. Let's call the new column logical compliment.

Click Create column and you will see the following result:

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

How does it work in LINQ?

Use the operator where...  to apply the Filter operation and select... as...  to apply the Create column 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`