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

PI Function

The  PI function generates the value of pi to 15 decimal place= s: 3.1415926535897932.

This function uses no parameters. Generated values are of Decimal type a= nd have fifteen digits of precision after the decimal point. If you want to= see a fewer number of digits in the generated value, you might need to app= ly a different number format or using the ROUND function.

Basic Usage= Output:
Returns the value of pi.

Syntax

There are no arguments for this function.

Examples

Example - pi column

In the following example, the source is simply the source column, and the pi column is generated by the&nb= sp;PI function:

=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 pi() 'pi'
=20

source pi
A

3.1415926535897932<= /p>

B

3.1415926535= 897932

C

3.1415926535= 897932

D

3.1415926535= 897932

Exampl= e - RANDBETWEEN, PI, and TRUNC functions

This example illustrates how you can apply the following functions to ge= nerate new and random data in your dataset:

• RANDBETWEEN - Generate a random Integer value between two = specified Integers. See RANDBE= TWEEN Function.
• PI - Generate the value of pi to 15 decimal points. See PI Function.
• ROUND - Round a decimal value to the nearest Integer or to= a specified number of digits. See R= OUND Function.
• TRUNC - Round a value down to the nearest Integer value. S= ee TRUNC Function.

Source:

In the following example, a company produces 10 circular parts, the size= of which is measured in each product's radius in inches.

=20 =20 =20
p001 1
p002 2
p003 3
p004 4
p005 5
p006 6
p007 7
p008 8
p009 9
p010 10

Based on the above data, the company wants to generate some additional s= izing information for these circular parts, including the generation of two= points along each part's circumference where quality stress tests can be a= pplied.

Transformation:

To begin, you can use the following steps to generate the area and circu= mference for each product, rounded to three decimal points:

=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 ROUND(PI() * (POW(radius_in, 2)), 3) 'area_sqin'
=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 ROUND(PI() * (2 * radius_in), 3)=20 'circumference_in'
=20

For quality purposes, the company needs two tests points along the circu= mference, which are generated by calculating two separate random locations = along the circumference. Since the RANDBETWEEN function only c= alculates using Integer values, you must first truncate the values from circumference_in:

=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 TRUNC(circumference_in) 'trunc_circumference_in'
=20

Then, you can calculate the random points using 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 formula Single row formula RANDBETWEEN(0, trunc_circumference_in) 'testPt01_in'
=20

=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 RANDBETWEEN(0, trunc_circumference_in) 'testPt02_in'
=20

Results:

After the trunc_circumference_in column is dropped, the dat= a should look similar to the following:

=20 =20 =20 =20 =20 =20 =20
prodId radius_in area_sq_in circumference_in testPt01_in testPt02_in
p001 1 3.142 6.283 5 5
p002 2 12.566 12.566 3 3
p003 3 28.274 18.850 13 13
p004 4 50.265 25.133 24 24
p005 5 78.540 31.416 0 0
p006 6 113.097 37.699 15 15
p007 7 153.938 43.982 11 11
p008 8 201.062 50.265 1 1
p009 9 254.469 56.549 29 29
p010 10 314.159 62.832 21 21

=20