Page tree



Contents:

The cloud-based version of Trifacta Wrangler is now available! Read all about it, and register for your free account.

Returns true if the argument is an even value. Argument can be an Integer, a function returning Integers, or a column reference.

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

Basic Usage

Integer literal value:

derive type:single value: ISEVEN('4') as: 'isFourEven'

Output: Generates the isFourEven column containing the value true for each row.

Column reference value:

delete row: (ISEVEN(errorCount))

Output: If the value in the errorCount column is an even number, then delete the row. 

Syntax

derive type:single value:ISEVEN(int_value)

ArgumentRequired?Data TypeDescription
int_valueYintegerThis value can be an Integer, a function returning an Integer, or a column reference.

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

int_value

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

  • Missing values generate missing string results.

Usage Notes:

Required?Data TypeExample Value
YesColumn reference, function, or Integer literal valuemyColumn

Examples

Example - Basic Equal and Notequal Functions

This example demonstrate the following 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 type:single 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 type:single value:NOTEQUAL(sideA * sideB, reportedArea) as:'isValidData'

You can also compute if the reportedArea can be divided into even square units:

derive type:single value:ISEVEN(reportedArea) as:'isReportedAreaEven'

You can test if either measured side is an odd number of units:

derive type:single value:IF((ISODD(sideA) == true) OR (ISODD(sideB) == true),TRUE,FALSE) as:'isSideOdd'


Results:

sideAsideBreportedAreaisSquareisValidDataisReportedAreaEvenisSideOdd
41456FALSEFALSETRUEFALSE
6635TRUETRUETRUEFALSE
8432FALSEFALSETRUEFALSE
1515200TRUETRUETRUETRUE
4728FALSEFALSETRUETRUE
12670FALSETRUETRUEFALSE
9981TRUEFALSEFALSEFALSE

 

Your Rating: Results: 1 Star2 Star3 Star4 Star5 Star 6 rates

This page has no comments.