NOTEQUAL Function

Returns true if the first argument is not equal to the second argument. Equivalent to the != operator.

  • Each argument can be a literal String, Integer or Decimal number, a function, or a column reference.

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 Comparison Operators.

Basic Usage

delete row: NOTEQUAL(myValue, checkSum)

Output: Deletes the row if the value in the myValue column does not equal the value in the checkSum column.

Syntax

derive value:NOTEQUAL(value1, value2)

ArgumentRequired?Data TypeDescription
value1YstringThe first value. This value can be a String, a number, a function, or a column reference.
value2YstringThe second value. This value can be a String, a number, a function, or a column reference.

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

value1, value2

Names of the columns, expressions, or literals to compare.

  • Missing values generate missing results.

Usage Notes:

Required?Data TypeExample Value
YesColumn reference, function, or numeric or String valuemyColumn

Examples

Example - Basic Equal and Notequal Functions

This example demonstrate the EQUAL and NOTEQUAL comparison functions.

In this example, the dataset contains current measurements of the sides of rectangular areas next to the size of those areas as previously reported. Using these functions, you can perform some light analysis of the data.

Source:

sideAsideBreportedArea
41456
6635
8432
1515200
4728
12670
9981

Transform:

In the first test, you are determining if the four-sided area is a square, based on a comparison of the measured values for sideA and sideB:

derive value:EQUAL(sideA, sideB) as:'isSquare'

Next, you can use the reported sides to calculate the area of the shape and compare it to the area previously reported:

derive value:NOTEQUAL(sideA * sideB, reportedArea) as:'isValidData'

Results:

sideAsideBreportedAreaisSquareisValidData
41456FALSEFALSE
6635TRUETRUE
8432FALSEFALSE
1515200TRUETRUE
4728FALSEFALSE
12670FALSETRUE
9981TRUEFALSE

Was this page helpful? Let us know how we did:

Send feedback about...

Google Cloud Dataprep Documentation