Date: Wed, 21 Oct 2020 21:27:57 +0000 (GMT) Message-ID: <497164302.15067.1603315677427@df68ed866f50> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_15066_812265596.1603315677427" ------=_Part_15066_812265596.1603315677427 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 trans= formation 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 transformation to flag all rows whose = city value equals San Francisco: =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20 Transformation Name<= code>New formulaParameter: Formula typeSingle row formulaParameter: 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 formulaParameter: Formula typeSingle row formulaParameter: Formulaif(city =3D=3D 'San Francisco', 'Home of t= he Giants!', 'Some other team')Parameter: New column name'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= Tip: For additional examples, see Common Tasks. 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. Less Than (or Equal To)<= /h3> =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 formulaParameter: Formula typeSingle row formulaParameter: Formula(MySource < 5) =20 true for all values in MySource that are less= than 5. Otherwise, false.    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 rowsParameter: ConditionCustom formulaParameter: Type of formulaCustom singleParameter: Condition(MySource <=3D 2.5)Parameter: ActionKeep matching rows =20 Retains all rows in the dataset where the value = in the MySource column is less than or equal to 2.5.   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 rowsParameter: ConditionCustom formulaParameter: Type of formulaCustom singleParameter: Condition(Date <=3D DATE(2009,12,31))=20 Parameter: ActionKeep matching rows =20 Retains all rows whose Date column = value is less than or equal to 12/31/2009. You can also use the DATEDIF= function to generate the number of days difference between t= wo date values. Then, you can compare this difference to another value. See= DATEDIF Function. String (and all other data types) =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 Transformation Name<= code>New formulaParameter: Formula typeSingle row formulaParameter: Formula(LEN(MySource) < 5)) =20 true for any string value in the MySource col= umn whose length is less than 5 characters. Otherwise, false See LEN Function. 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. 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 formulaParameter: Formula typeSingle row formulaParameter: 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 rowsParameter: ConditionCustom formulaParameter: Type of formulaCustom singleParameter: Condition(MySource =3D=3D 2.5)Parameter: ActionKeep 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 rowsParameter: ConditionCustom formulaParameter: Type of formulaCustom singleParameter: Condition(Date =3D=3D DATE(2016,12,25))Parameter: ActionKeep 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 rowsParameter: ConditionCustom formulaParameter: Type of formulaCustom singleParameter: Condition(LEN(MySource) =3D=3D 5))Parameter: ActionKeep 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 formulaParameter: Formula typeSingle row formulaParameter: 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 rowsParameter: ConditionCustom formulaParameter: Type of formulaCustom singleParameter: Condition(MySource <> 2.5)Parameter: ActionKeep 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 rowsParameter: ConditionCustom formulaParameter: Type of formulaCustom singleParameter: Condition(Date <> DATE(2016,4,15))=20 Parameter: ActionKeep 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 rowsParameter: ConditionCustom formulaParameter: Type of formulaCustom singleParameter: Condition(LEN(MySource) <> 5))Parameter: ActionKeep 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 See Also:=20 =20 =20 =20 Page:= =20 =20 =20 GREATERT= HANEQUAL Function=20 =20 =20 =20 Page:= =20 =20 =20 ISODD Function= =20 =20 =20 =20 Page:= =20 =20 =20 EQUAL Function= =20 =20 =20 =20 Page:= =20 =20 =20 NOTEQUAL Functio= n=20 =20 =20 =20 Page:= =20 =20 =20 ISEVEN Function=20 =20 =20 =20 Page:= =20 =20 =20 GREATERTHAN F= unction=20 =20 =20 =20 Page:= =20 =20 =20 LESSTHANEQU= AL Function=20 =20 =20 =20 Page:= =20 =20 =20 LESSTHAN Functio= n=20 =20 =20 =20 Page:= =20 =20 =20 Comparison Fu= nctions=20 =20 =20 =20 Page:= =20 =20 =20 IN Function=20 =20 =20 =20 Page:= =20 =20 =20 MATCHES Function<= /a>=20 =20 =20 =20 Page:= =20 =20 =20 Comparison Op= erators=20 =20 =20 =20 =20 ```
``` ------=_Part_15066_812265596.1603315677427-- ```