NOT Function

Returns true if the argument evaluates to false, and vice-versa. Equivalent to the ! operator.

  • The argument can be a literal Boolean, a function returning a Boolean, or a reference to a column containing Boolean values.

Since the function returns a Boolean value, it can be used as a function or a conditional.

NOTE: Within an expression, you might choose to use the corresponding operator, instead of this function. For more information, see Logical Operators.

Basic Usage

derive value: NOT(customerHappiness > 70) as:'contactCustomer'

Output: If the value in the customerHappiness column is not greater than 70 then the value in the new contactCustomer column is true. Otherwise, the value is false.


derive value:NOT(value1)

ArgumentRequired?Data TypeDescription
value1YstringThe value must be a Boolean literal, column reference, or expression that evaluates to true or false.

For more information on syntax standards, see Language Documentation Syntax Notes.


Expression, column reference or literal that evaluates to a Boolean value.

  • Missing or mismatched values generate missing results.

Usage Notes:

Required?Data TypeExample Value
YesFunction or column reference returning a Boolean value or Boolean literalmyHeight > 2.00


Example - Logical Functions

This example demonstrate the AND, OR, and NOT logical functions.

In this example, the dataset contains results from survey data on two questions about customers. The yes/no answers to each question determine if the customer is 1) still active, and 2) interested in a new offering.




Customers that are both active and interested should receive a phone call:

derive value:AND(isActive, isInterested) as:'phoneCall'

Customers that are either active or interested should receive an email:

derive value:OR(isActive, isInterested) as:'sendEmail'

Customers that are neither active or interested should be dropped from consideration for the offering:

derive value:AND(NOT(isActive),NOT(isInterested) as:'dropCust'

A savvy marketer might decide that if a customer receives a phone call, that customer should not be bothered with an email, as well:

set col:sendEmail value:IF(phoneCall == "TRUE", FALSE, sendEmail)



Send feedback about...

Google Cloud Dataprep Documentation