Date: Thu, 6 Oct 2022 11:48:20 +0000 (UTC) Message-ID: <228307873.8398.1665056900723@93e1396c9615> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8397_1527067699.1665056900722" ------=_Part_8397_1527067699.1665056900722 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html EXAMPLE - Comparison Functions2

# EXAMPLE - Comparison Functions2

This example demonstrates functions for comparing the relative valu= es of two functions.

Functions:

=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Item Description
LESSTHANEQUAL Function Returns `true` if the firs= t argument is less than or equal to the second argument. Equivalent to the = `<=3D` operator.
LESSTHAN Function Returns `true` if the firs= t argument is less than but not equal to the second argument. Equivalent to= the `<` operator.
GREATERTHANEQUAL Function Returns `true` if the firs= t argument is greater than or equal to the second argument. Equivalent to t= he `>=3D` operator.
GREATERTHAN Function Returns `true` if the firs= t argument is greater than but not equal to the second argument. Equivalent= to the `>` operator.

In the town of Circleville, citizens are allowed to maintain a sin= gle crop circle in their backyard, as long as it confirms to the town regul= ations. Below is some data on the size of crop circles in town, with a sepa= rate entry for each home. Limits are displayed in the adjacent columns, wit= h the `inclusive` columns indicating whether the = minimum or maximum values are inclusive.

Tip: As part of this exercise, you can see how to you c= an extend your recipe to perform some simple financial analysis of the data= .

Source:

=20 =20 =20 =20 =20 =20 =20
House1 55.5 10 Y 25 N
House2 12 10 Y 25 N
House3 14.25 10 Y 25 N
House4 3.5 10 Y 25 N
House5 27 10 Y 25 N

Transformation:

After the data is loaded into the Transformer page, you can begin compar= ing column values:

=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` `LESSTHANEQUAL(Radius_ft,minRadius_ft)` `'tooSmall'`
=20

While accurate, the above transform does not account for the ```minIn= clusive``` value, which may be changed as part of your steps. Instead, = you can delete the previous transform and use the following, which factors = in the other column:

=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(minInclusive =3D=3D 'Y',LESSTHANEQUAL(R= adius_ft,minRadius_ft),LESSTHAN(Radius_ft,minRadius_ft))``` `'tooSmall'`
=20

In this case, the `IF` function tests whether the minimum val= ue is inclusive (values of `10` are allowed). If so, the ```L= ESSTHANEQUAL``` function is applied. Otherwise, the ```LESSTHAN function is applied. For the maximum limit, the following step applies:<= /p> ```

` `

``` =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(maxInclusive =3D=3D 'Y', GREATERTHANEQU= AL(Radius_ft,maxRadius_ft),GREATERTHAN(Radius_ft,maxRadius_ft))Parameter: New column name'tooBig' =20 Now, you can do some analysis of this data. First, you can insert a colu= mn containing the amount of the fine per foot above the maximum or below th= e minimum. Before the first derive command, insert the followi= ng, which is the fine (\$15.00) for each foot above or below th= e limits: =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: Formula15Parameter: New column name'fineDollarsPerFt' =20 At the end of the recipe, add the following new line, which calculates t= he fine for crop circles that are too small: =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(tooSmall =3D=3D 'true', (minRadius_ft -= Radius_ft) * fineDollarsPerFt, 0.0)Parameter: New column name'fine_Dollars' =20 The above captures the too-small violations. To also capture the too-big= violations, change the above to the following: =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(tooSmall =3D=3D 'true', (minRadius_ft -= Radius_ft) * fineDollarsPerFt, if(tooBig =3D=3D 'true', (Radius_ft - maxRa= dius_ft) * fineDollarsPerFt, '0.0'))Parameter: New column name'fine_Dollars' =20 In place of the original "false" expression (0.0), the abov= e adds the test for the too-big values, so that all fines are included in a= single column. You can reformat the fine_Dollars column to be= in dollar format: =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 Transformation NameEdit column with formulaParameter: Columnsfine_DollarsParameter: FormulaNUMFORMAT(fine_Dollars, '\$###.00')<= /td>=20 =20 Results: After you delete the columns used in the calculation and move the remain= ing ones, you should end up with a dataset similar to the following: =20 =20 =20 =20 =20 =20 =20 =20 =20 Location fineDollarsPerFt Radius_ft minRadius_ft minInclusive maxRadius_ft maxInclusive fineDollars House1 15 55.5 10 Y 25 N \$457.50 House2 15 12 10 Y 25 N \$0.00 House3 15 14.25 10 Y 25 N \$0.00 House4 15 3.5 10 Y 25 N \$97.50 House5 15 27 10 Y 25 N \$30.00 Now that you have created all of the computations for generating t= hese values, you can change values for minRadius_ft , maxRadius_ft , and fineDolla= rsPerFt to analyze the resulting fine revenue. Before or afte= r the transform where you set the value for fineDollarsPerFt, = you can insert something like the following: =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 Transformation NameEdit column with formulaParameter: ColumnsminRadius_ftParameter: Formula'12.5' =20 After the step is added, select the last line in the recipe. Then, you c= an see how the values in the fineDollars column have been upda= ted. =20 =20 See Also for EXAMPLE - Comparison Functions2:=20 =20 =20 Page:<= /span>=20 =20 GREATERTHAN Function=20 =20 =20 Page:<= /span>=20 =20 GREATERTHANEQUAL Function=20 =20 =20 Page:<= /span>=20 =20 LESSTHAN Function=20 =20 =20 Page:<= /span>=20 =20 LESSTHANEQUAL Function=20 =20 =20 =20 =20 =20 ```
``` ------=_Part_8397_1527067699.1665056900722-- ```