This document introduces the numeric functions supported by the New Calculation Column operator.
ABS(Numeric)
Description
The ABS() function returns the absolute value of a number.
Formula Logic
Returns the absolute value of the specified number. The value is always non-negative.
If any parameter is NULL, the result is NULL.
Output Type
Numeric
Example
ABS(-1.5) returns 1.5.
ABS(0) returns 0.
ABS(2.5) returns 2.5.
SIN(Radian)
The SIN() function returns the sine of a given angle.
Calculates the sine of a given angle.
If the value of the parameter is in degrees, multiply it by PI()/180 to convert it to radians.
SIN(10) returns -0.54.
SIN(45*PI()/180) returns 0.71.
Returns the arcsine value of the given number.
The ASIN() function returns the arcsine value of the given number.
ASIN(Sine)
Returns the arcsine, or inverse sine, of a number. The arcsine value is an angle given in radians.
The value of the parameter should be between -1 and 1 (inclusive). The returned angle is between -pi/2 and pi/2 (inclusive). To express the returned angle in degrees, multiply the result by 180/PI().
If any parameter is set to NULL, the result is NULL. (The result in FineBI is 0.)
ASIN(0.5) returns 0.523598776 (PI/6 radians).
ASIN(1) returns 1.570796327 (PI/2 radians).
ASIN(0.5)*180/PI() returns 30 (degrees).
COS(Radian)
The COS() function returns the cosine of a given angle.
Returns the cosine of a given angle.
To express the returned angle in radians, multiply the result by PI()/180. COS(n*2*PI()+number)=COS(Number) (n is an integer and the number is from -pi to pi.)
COS(0.5) returns 0.877582562.
COS(30*PI()/180) returns 0.866025404.
The ACOS() function returns the arccosine of the given number.
ACOS(Cosine)
Returns the arccosine, or inverse cosine, of a number. The arccosine value is an angle given in radians.
The parameter value should range from -1 to 1 (inclusive). The returned angle value is between 0 and PI. To express the returned angle in degrees, multiply it by 180/PI().
ACOS(1) returns 0 (radians).
ACOS(0.5) returns 1.047197551 (PI/3 radians).
ACOS(0.5)*180/PI() returns 60 (degrees).
TAN(Radian)
The TAN() function returns the tangent of the specified angle.
TAN(Radian) Returns the tangent value of the specified angle.
If the parameter is in degrees, multiply it by PI()/180 to convert it to radians.
TAN(0.8) returns 1.029638557.
TAN(45*PI()/180) returns 1.
ATAN(Tangent)
The ATAN() function returns the arctangent value of the given number.
ATAN(Arctangent)
Calculates the arctangent, or inverse tangent, of a given number. The given number is the returned tangent value of an angle expressed in radians.
The returned angle is between -pi/2 and pi/2 (exclusive). Cannot return angles -pi/2 or pi/2. To express the returned angle in degrees, multiply the result by 180/PI().
ATAN(-1) returns –0.785398163 (–PI/4 radians).
ATAN(0) returns 0 (radians).
ATAN(2)*180/PI() returns 63.43494882 (degrees).
ATAN2(X-coordinate, Y-coordinate)
The ATAN2() function returns the arctangent value of the given coordinates.
Returns the arctangent of X- and Y- coordinates. The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and the point (X-coordinate, Y-coordinate). This angle is expressed in radians.
A positive result represents a counterclockwise angle from the x-axis. A negative result represents a clockwise angle. When a > 0 and b > 0 or a > 0 and b < 0, the formula holds directly. When a < 0 and b > 0, ATAN2(a,b)=PI()-ABS(ATAN(b/a)). When a<0 and b<0, ATAN2(a,b)=ABS(ATAN(b/a))-PI(). When the return value is displayed in degrees, multiply the return value by 180/PI()to express it in radians (the return value is greater than -pi and less than or equal to pi).
ATAN2(-2,2) returns 2.356194490192345 (3 * PI/4 radians).
ATAN2(2,2) returns 0.785398163 (PI/4 radians)
ATAN2(-2,2)*180/PI() returns 135 (degrees).
CEILING(Numeric)
The CEILING() function rounds up the Numeric to the nearest integer larger than or equal to the parameter value.
Rounds up the Numeric to the nearest integer larger than or equal to the parameter value.
CEILING(-2.5) returns –2.
CEILING(0.5) returns 1.
CEILING(1.25) returns 2.
FLOOR(Numeric)
The FLOOR() function rounds down the Numeric to the nearest integer less than or equal to the parameter value.
Rounds down the Numeric to the nearest integer less than or equal to the parameter value.
FLOOR(-2.5) returns –3.
FLOOR(2.5) returns 2.
Add a New Calculation Column operator in the Data Transformation node and name it. Enter the formula FLOOR(discount) with one decimal place kept, and click OK, as shown in the following figure.
ROUND(Numeric, Number of decimal places)
The ROUND() function rounds a number to the specified number of digits.
Returns the number rounded to the specified number of decimal places.
If the number of decimal places is less than 0, the number is rounded to the left of the decimal point.
If the number of decimal places is equal to 0, the number is rounded to the nearest integer.
If the number of decimal places is greater than 0, the number is rounded to the specified number of decimal places.
ROUND(2.15,1) returns 2.2.
ROUND(2.149,1) returns 2.1.
ROUND(-1.475,2) returns –1.48.
ROUND(21.5,-1) returns 20.
Add a New Calculation Column operator in the Data Transformation node and name it. Enter the formula ROUND(discount, 1) with one decimal place kept, and click OK, as shown in the following figure.
POWER(Base, Exponent)
The POWER() function returns the power of a specified number.
POWER(Base, Exponent) returns the result of a number raised to a power.
The base is raised to the power of the specified exponent.
POWER(6,2) returns 36.
POWER(14,5) returns 537824.
POWER(4,2/3) returns 2.52.
POWER(3,-2.3) returns 0.08.
EXP(Exponent)
The EXP() function returns the n-th power of e.
Returns the n-th power of e. The constant e is the base of the natural logarithm and approxiamately equals 2.71828182845904.
The EXP() function and the LN() function are mutually inverse.
EXP(0) returns 1.
EXP(3) returns 20.09.
EXP(LN(2)) returns 2.
LN(Positive real number)
The LN() function returns the logarithm of a number to the base of e.
Returns the natural logarithm of a number. The natural logarithm is based on the constant e (2.71828182845904).
LN(86) returns 4.45437.
LN(2.7182818) returns 1.
LN(EXP(3)) returns 3.
EXP(LN(4)) returns 4.
LOG(Positive real number, Base)
The LOG() function calculates the logarithm of a number to any specified base. If omitted, the base is 10 by default.
LOG(Positive real number, Base) returns the logarithm of a number to any specified base.
LOG(16,2) returns 4.
LOG(10) returns 1.
LOG(24,3) returns 2.90.
MAX(Numeric 1, Numeric 2, ...)
The MAX() function returns the maximum value in a set of values.
Returns the maximum value in a set of values.
MAX(1,2,3,4,5) returns 5.
The MIN() function returns the minimum value in a set of values.
MIN(Numeric 1, Numeric 2, ...)
Returns the minimum value in a set of values.
MIN(1,2,3,4,5) returns 1.
MOD(Dividend, Divisor)
The MOD() function returns the remainder after the dividend is divided by the divisor.
Returns the remainder after the dividend is divided by the divisor. The result has the same sign as the divisor.
If the divisor is 0, the returned remainder is infinite. If the dividend is 0, the returned remainder is 0.
MOD(3,2) returns 1.
MOD(-3,2) returns 1.
MOD(3,-2) returns –1.
MOD(-3,-2) returns –1.
The PI() function returns a multiple of pi.
PI(Multiple) is a mathematical constant function.
When the multiple is omitted, the function returns the value of pi that approximately equals 3.14.
When the multiple is specified, the function returns the corresponding integer multiple of pi.
SIN(PI()/2) returns 1.
The formula for the area of a circle is S=PI()*(r^2), in which S represents the area and R the radius.
PI(3) returns 9.42.
RAND()
The RAND() function returns an evenly distributed random number.
Returns an evenly distributed random number. A new random number is returned every time the worksheet is calculated.
To generate a random number between a and b, you can use RAND()*(b-a)+a.
RAND()*60 generates a random number greater than or equal to 0 and less than 60.
RAND()*19 generates a random number greater than or equal to 0 and less than 19.
Add a New Calculation Column operator in the Data Transformation node and name it. Enter the formula RAND() to obtain a random number greater than or equal to 0 and less than 1, and click OK, as shown in the following figure.
SIGN(Numeric)
The SIGN() function returns a value representing the sign of a number.
Returns a value representing the sign of a number. Returns 1 for positive numbers, 0 for zero, and -1 for negative numbers.
SIGN(10) returns 1.
SIGN(4-4) returns 0.
SIGN(-0.00001) returns –1.
SQRT(Numeric)
The SQRT() function returns the arithmetic square root of a non-negative number.
Returns the arithmetic square root of a non-negative number.
SQRT(64) returns 8.
SQRT(-64) returns NULL.
TRUNC(Numeric, Precision)
The TRUNC() function returning a number with a specified number of decimal places
Truncates a number to an integer or a decimal by removing a specified number of decimal places.
TRUNC(8.9) returns 8.
TRUNC(-8.9) returns –8.
TRUNC(-8.98,1) returns –8.9.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy