Message-ID: <1274974707.2063.1571861838527.JavaMail.daemon@e613c95ee270> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2062_504718884.1571861838527" ------=_Part_2062_504718884.1571861838527 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Comparison Operators

Comparison Operators

Contents:

=20

=20
=20
=20

=20
=20

Comparison operators enable you to compare values in the left-hand s= ide of an expression to the values in the right-hand side of an expression.
=20
(left-hand=
side) (operator) (right-hand side)
=20

These evaluations result in a Boolean true or false result and can be used as the basis for determining whether the actio= n of transform is executed on the row or column of data. The following oper= ators are supported:

=20 =20 =20 =20 =20 =20
Operator Name Symbol Example Expression Output Notes
less than <

3 < 6

true
less than or equal to <=3D

6 <=3D 5

false The following operator generates a= n error: =3D<
greater than >

3 > 6

false
greater than or equal to >=3D

6 >=3D 5

true The following operator= generates an error: =3D>
equal to =3D=3D 4 =3D=3D 4 true For this comparison operator= , you must use two equals signs, or an error is generated.
not equal to

<> or=

!=3D

4 <> 4 false

Both operators are suppor= ted.

The following operator generates an er= ror: =3D!

The above examples apply to integer values only. Below, you can review h= ow the comparison operators apply to different data types.

Usage

Comparison operators are used to determine the condition of a set of dat= a. Typically, they are applied in evaluations of values or rows.

For example, your dataset is the following:

city
San Francisco
Los Angeles
Chicago
New York

You could use the following transform to flag all rows whose city<= /code> value equals San Francisco:

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20
Transformation Name <= code>New formula Single row formula (city =3D=3D 'San Francisco')
=20

Your output looks like the following:

=20 =20 =20
city column1
San Francisco true
Los Angeles false
Chicago false
New York false

You can optionally combine the above with an IF function, w= hich enables you to write values for true or false outcomes:

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name <= code>New formula Single row formula if(city =3D=3D 'San Francisco', 'Home of t= he Giants!', 'Some other team') 'BaseballTeam'
=20

Note that the optional as: clause can be used to rename the= generated columns. See Derive Tra= nsform.

city BaseballTeam
San Francisco Home of the Giants!
Los Angeles Some other team
Chicago Some other team
New York Some other team

Examples=

NOTE: When a comparison is applied to a set of values, = the type of data of each source value is re-inferred to match any literal v= alues used on the other side of the expression. This method allows for more= powerful comparisons.

In the following examples, values taken from the MySource c= olumn are re-typed to match the inferred data type of the other side of the= comparison.

Greater Than (or Equa= l To)

See previous section.

Equal to

=20 =20 =20 =20 =20
Column Type Example Transformation Output Notes
Integer

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name <= code>New formula Single row formula (MySource =3D=3D 5)
=20

• true for all values in the MySource column th= at are 5.
• Otherwise, false.
If the source column contains Decima= l values and the right-hand side is an integer value, the Deci= mal values that are also integers can match in the comparison (e.g. = 2.0 =3D=3D 2).
Decimal

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name <= code>Filter rows Custom formula Custom single (MySource =3D=3D 2.5) Keep matching rows
=20

Retains all rows in the dataset where the value = in the MySource column is exactly 2.5. If the source column contains integers and the r= ight-hand side is a Decimal type value, integer values are rou= nded for comparison.
Datetime

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20 =20 =20 =20 =20
Transformation Name <= code>Filter rows Custom formula Custom single (Date =3D=3D DATE(2016,12,25)) Keep matching rows
=20

Retains all rows whose Date<= /code> column value is equal to 12/25/2016 .
String (and all other data types)

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name <= code>Filter rows Custom formula Custom single (LEN(MySource) =3D=3D 5)) Keep matching rows
=20

Retains all rows in the dataset where the length= of the string value in the MySource column is 5 characters.
• For comparison purposes, all data types not previously listed in this t= able behave like strings.
• Since strings are non-numeric value, a function must be applied to stri= ng data to render a comparison.

Not Equal to

=20 =20 =20 =20 =20
Column Type Example Transformation Output Notes
Integer

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name <= code>New formula Single row formula (MySource <> 5)
=20

• true for all values in the MySource column th= at are not 5.
• Otherwise, false.
If the source column contains Decima= l values and the right-hand side is an integer value, the Deci= mal values that are also integers can match in the comparison (e.g. = 2.0 =3D=3D 2 ).
Decimal

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name <= code>Filter rows Custom formula Custom single (MySource <> 2.5) Keep matching rows
=20

Retains all rows in the dataset where the = value in the MySource column is not 2.5.= If the source column contains integers and= the right-hand side is a Decimal type value, integer values a= re rounded for comparison.
Datetime

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name <= code>Filter rows Custom formula Custom single (Date <> DATE(2016,4,15))=20 Keep matching rows
=20

Retains all rows in the dataset where the = Date value does not equal 4/15/2016.
String (and all other data types)

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name <= code>Filter rows Custom formula Custom single (LEN(MySource) <> 5)) Keep matching rows
=20

Retains all rows in the dataset where the = length of the string value in the MySource colu= mn is not 5 characters.
• For comparison purposes, all data types not previously listed in this t= able behave like strings.
• Since strings are non-numeric value, a function must be applied to stri= ng data to render a comparison.

=20