Skip to content

Math function

Estimated reading: 11 minutes 575 views
ABS

The ABS function, short for “absolute,” is a mathematical function used to return the absolute (non-negative) value of a numeric expression. The absolute value of a number is its distance from zero on the number line, irrespective of the direction.

Syntax – ABS(numeric column)

Example: We are finding the absolute value of sales.

Example Queries:

  • ABS([orders].[profit])
  • ABS([orders].[sales])
  • ABS([orders].[order_discount])
  • ABS([orders].[shipping_cost])
  • ABS([product].[total_discount])
ACOS

The ACOS function, short for “arccosine,” is a mathematical function used to calculate the inverse cosine of a number. In trigonometry, the arccosine of an angle is the angle whose cosine is the given number. The result is usually returned in radians.

Syntax – ACOS(numeric column)

Example: We are calculating the arccosine value of the discount.

Example Queries:

  • ACOS([orders].[profit])
  • ACOS([orders].[sales])
  • ACOS([orders].[order_discount])
  • ACOS([orders].[shipping_cost])
  • ACOS([product].[total_discount])
ASIN

The ASIN function, short for “arcsine,” is a mathematical function used to calculate the inverse sine of a number. In trigonometry, the arcsine of an angle is the angle whose sine is the given number. The result is typically returned in radians.

Syntax – asin(numeric column)

Example: We are calculating the arcsine of sales.

Example Queries:

  • ASIN([orders].[profit])
  • ASIN([orders].[sales])
  • ASIN([orders].[order_discount])
  • ASIN([orders].[shipping_cost])
  • ASIN([product].[total_discount])
ATAN

The ATAN function, short for “arctangent,” is a mathematical function used to calculate the inverse tangent of a number. In trigonometry, the arctangent of a number is the angle whose tangent is the given number. The result is typically returned in radians.

Syntax – atan(numeric column)

Example: We are calculating the arctangent of discount.

Example Queries:

  • ATAN([orders].[profit])
  • ATAN([orders].[sales])
  • ATAN([orders].[order_discount])
  • ATAN([orders].[shipping_cost])
  • ATAN([product].[total_discount])
CBRT

The CBRT function, short for “cube root,” is a mathematical function that calculates the cube root of a given number. The cube root of a number is a value that, when multiplied by itself twice (raised to the power of 3), results in the original number.

Syntax – cbrt(numeric column)

Example: We are calculating the cube root of the discount.

Example Queries:

  • CBRT([orders].[profit])
  • CBRT([orders].[sales])
  • CBRT([orders].[order_discount])
  • CBRT([orders].[shipping_cost])
  • CBRT([product].[total_discount])
CEIL

The CEIL function, short for “ceiling,” is a mathematical function that rounds a number to the nearest integer greater than or equal to the original number. It effectively rounds up the number to the next whole integer.

Syntax – ceil(numeric column)

Example: We are rounding the discount to the nearest greater or equal number.

Example Queries:

  • CEIL([orders].[profit])
  • CEIL([orders].[sales])
  • CEIL([orders].[order_discount])
  • CEIL([orders].[shipping_cost])
  • CEIL([product].[total_discount])
COS

The COS function, short for “cosine,” is a mathematical function that calculates the cosine of an angle. In trigonometry, the cosine of an angle in a right-angled triangle is defined as the ratio of the length of the adjacent side to the length of the hypotenuse. The COS function extends this concept to any angle in radians.

Syntax – cos(numeric column)

Example: We are finding cosine of order discount.

Example Queries:

  • COS([orders].[profit])
  • COS([orders].[sales])
  • COS([orders].[order_discount])
  • COS([orders].[shipping_cost])
  • COS([product].[total_discount])
COSH

The COSH function, short for “hyperbolic cosine,” is a mathematical function that calculates the hyperbolic cosine of a number. Hyperbolic cosine is a hyperbolic trigonometric function, and it is defined using exponential functions.

Syntax – cosh(numeric column)

Example: We are finding the hyperbolic cosine at a discount.

Example Queries:

  • COSH([orders].[profit])
  • COSH([orders].[sales])
  • COSH([orders].[order_discount])
  • COSH([orders].[shipping_cost])
  • COSH([product].[total_discount])
COT

The COT function, short for “cotangent,” is a mathematical function that calculates the cotangent of an angle. The cotangent is a trigonometric function defined in terms of the cosine and sine of an angle.

Syntax – cot(numeric column)

Example: We are calculating the cotangent of sales.

Example Queries:

  • COT([orders].[profit])
  • COT([orders].[sales])
  • COT([orders].[order_discount])
  • COT([orders].[shipping_cost])
  • COT([product].[total_discount])
EXP

The EXP function, short for “exponential,” is a mathematical function that calculates the value of the mathematical constant e raised to the power of a specified number. The mathematical constant e is an irrational number approximately equal to 2.71828.

Syntax – exp(numeric column)

Example: We are calculating the exponentials of discount.

Example Queries:

  • EXP([orders].[profit])
  • EXP([orders].[sales])
  • EXP([orders].[order_discount])
  • EXP([orders].[shipping_cost])
  • EXP([product].[total_discount])
FLOOR (Floor Value)

The FLOOR function is a mathematical function that rounds a numeric value down to the nearest integer that is less than or equal to the original value. In other words, it returns the largest integer that is less than or equal to the specified number.

Syntax – floor(numeric column)

Example: We are finding the floor of discount.

Example Queries:

  • FLOOR([orders].[profit])
  • FLOOR([orders].[sales])
  • FLOOR([orders].[order_discount])
  • FLOOR([orders].[shipping_cost])
  • FLOOR([product].[total_discount])
LN (Natural Algorithm)

The LN function, also known as the natural logarithm function, is a mathematical function that calculates the logarithm of a given number to the base “e,” where “e” is the mathematical constant approximately equal to 2.71828. The natural logarithm is the inverse function of the exponential function with base “e.”

Syntax – LN(numeric column)

Example: We are finding the natural logarithm of discount.

Example Queries:

  • LN([orders].[profit])
  • LN([orders].[sales])
  • LN([orders].[order_discount])
  • LN([orders].[shipping_cost])
  • LN([product].[total_discount])
LOG (Logarithm)

The LOG function is a mathematical function that calculates the logarithm of a given number with a specified base. In the context of the LOG function, the base is the number to which the logarithm is calculated. The most common bases are 10 (common logarithm) and the mathematical constant “e” (natural logarithm).

Syntax – log(numeric column)

Example: We are finding the logarithm of discount.

Example Queries:

  • LOG([orders].[profit])
  • LOG([orders].[sales])
  • LOG([orders].[order_discount])
  • LOG([orders].[shipping_cost])
  • LOG([product].[total_discount])
LOG10 (Base-10 Logarithm)

The LOG10 function is a mathematical function that calculates the base-10 logarithm of a given number. In other words, it returns the exponent to which the base (10) must be raised to produce the specified number.

Syntax – log10(numeric column)

Example: We are calculating the base-10 logarithm of order discount.

Example Queries:

  • LOG10([orders].[profit])
  • LOG10([orders].[sales])
  • LOG10([orders].[order_discount])
  • LOG10([orders].[shipping_cost])
  • LOG10([product].[total_discount])
MOD (Modulo)

The MOD function, short for modulo, is a mathematical operation that returns the remainder of the division of one number by another. It calculates the remainder when the first number (dividend) is divided by the second number (divisor).

Syntax – mod(numeric column, integer value)

Example: We are finding the remainder of the division of sales by 4.

Example Queries:

  • MOD([orders].[profit], 5)
  • MOD([orders].[sales], 10)
  • MOD([orders].[order_discount], 3)
  • MOD([orders].[shipping_cost], 2)
  • MOD([product].[total_discount], 7)
PI

The PI function returns the mathematical constant ? (pi), which represents the ratio of a circle’s circumference to its diameter. In mathematical terms, ? is an irrational number, approximately equal to 3.14159. The PI function typically doesn’t take any arguments; it simply returns the constant value.

Syntex – PI

Example: Pi value is 3.14.

Example Queries:

  • 2 * PI * [Retail].[Quantity]
  • PI * POWER([Retail].[Quantity], 2)
  • (4/3) * PI * POWER([Retail].[Quantity], 3)
  • 2 * PI * [Retail].[Shipping Cost]
  • 4 * PI* POWER([Retail].[Quantity], 2)
POWER (Exponentiation)

The POWER function, also known as the exponentiation function, is a mathematical function that raises a specified number to the power of another number. It is used to calculate the result of raising a base to a given exponent.

Syntax – power(numeric column, integer)

Example: We are applying Power 4 to sales.

Example Queries:

  • POWER([orders].[profit], 2)
  • POWER([orders].[sales], 3)
  • POWER([orders].[order_discount], 2)
  • POWER([orders].[shipping_cost], 4)
  • POWER([product].[total_discount], 2)
RADIANS (Convert Degrees to Radians)

The RADIANS function is a mathematical function that converts an angle measured in degrees to its equivalent in radians. Radians are a unit of angular measurement used in mathematics and physics, and they are particularly convenient for trigonometric calculations.

Syntax – radians(numeric column)

Example: we are finding radian values of sales.

Example Queries:

  • RADIANS([orders].[profit])
  • RADIANS([orders].[sales])
  • RADIANS([orders].[order_discount])
  • RADIANS([orders].[shipping_cost])
  • RADIANS([product].[total_discount])
DEGREES (Convert Radians to Degrees)

The DEGREES function is a mathematical function that converts an angle measured in radians to its equivalent in degrees. Degrees are a unit of angular measurement commonly used in everyday contexts, while radians are frequently used in mathematical and scientific calculations, particularly in trigonometry.

Syntax – degrees(numeric column)

Example: We are calculating the degree of sales.

Example Queries:

  • DEGREES([orders].[profit])
  • DEGREES([orders].[sales])
  • DEGREES([orders].[order_discount])
  • DEGREES([orders].[shipping_cost])
  • DEGREES([product].[total_discount])
RANDOM

The RANDOM function is a mathematical function that generates a random number between 0 (inclusive) and 1 (exclusive). It is commonly used in programming and mathematical simulations to introduce randomness into computations.

Syntax – random()

Example: We are generating random integers.

RANDOM INT

The RANDOM INT function is a mathematical function that generates a random integer within a specified range. It is commonly used in programming and simulations when you need a random whole number within a specific numerical range.

Syntax – random int(integer)

Example: We are generating random integers in the given range.

Example Queries:

  • RANDOMINT(100) — Generates a random integer between 0 and 100
  • RANDOMINT(500) — Generates a random integer between 0 and 500
  • RANDOM_INT(1000) — Generates a random integer between 0 and 1000
  • RANDOM_INT(10) — Generates a random integer between 0 and 10
  • RANDOM_INT(50)   — Generates a random integer between 0 and 50
ROUND (Round Numeric Value to Specified Precision)

The ROUND function is a mathematical function used to round a numeric value to a specified number of decimal places. It is commonly employed to simplify or limit the precision of numerical data.

Syntax – round(numeric column [, integer])

Example: Here we are rounding off the sales value.

Example Queries:

  • ROUND([orders].[profit], 2)
  • ROUND([orders].[sales], 1)
  • ROUND([orders].[order_discount], 0)
  • ROUND([orders].[shipping_cost], 3)
  • ROUND([product].[total_discount], 2)
SIN

The SIN function is a mathematical function that calculates the sine of an angle. The sine of an angle in a right-angled triangle is the ratio of the length of the side opposite the angle to the length of the hypotenuse. In a broader context, the SIN function is used to compute the sine value for any given angle.

Syntax – sin(numeric column)

Example: Finding sine of Sales.

Example Queries:

  • SIN([orders].[profit])
  • SIN([orders].[sales])
  • SIN([orders].[order_discount])
  • SIN([orders].[shipping_cost])
  • SIN([product].[total_discount])

SINH

The SINH function is a mathematical function that calculates the hyperbolic sine of a given angle. Hyperbolic functions, including hyperbolic sine, are analogues of trigonometric functions but define using the hyperbola rather than the unit circle. The hyperbolic sine is commonly denoted as:

Syntax – sinh(numeric column)

Example: Finding hyperbolic sine of Order discount.

Example Queries:

  • SINH([orders].[profit])
  • SINH([orders].[sales])
  • SINH([orders].[order_discount])
  • SINH([orders].[shipping_cost])
  • SINH([product].[total_discount])
SQRT

The SQRT function is a mathematical function that calculates the square root of a given number. The square root of a number is

In other words, it represents the value which, when multiplied by itself, equals the original number.

Syntax – sqrt(numeric column)

Example: We are calculating the square root of sales.

Example Queries:

  • SQRT([orders].[profit])
  • SQRT([orders].[sales])
  • SQRT([orders].[order_discount])
  • SQRT([orders].[shipping_cost])
  • SQRT([product].[total_discount])
TAN

The TAN function is a trigonometric function that calculates the tangent of a given angle. In trigonometry, the tangent of an angle in a right-angled triangle is the ratio of the length of the side opposite the angle to the length of the adjacent side.

Syntax – tan(numeric column)

Example: Finding tangent of Sales.

Example Queries:

  • TAN([orders].[profit])
  • TAN([orders].[sales])
  • TAN([orders].[order_discount])
  • TAN([orders].[shipping_cost])
  • TAN([product].[total_discount])
TANH

The TANH function, or hyperbolic tangent function, is a mathematical function commonly used in calculus and mathematical analysis. It is defined as:

TANH(x)=sinh(x)/cosh

Here:

  • sinh(x) represents the hyperbolic sine function.
  • cosh(x) represents the hyperbolic cosine function.

The TANH function maps real numbers to the open interval (-1,1).

Syntax – tanh(numeric column)

Example: Finding hyperbolic tangent of Order discount.

Example Queries:

  • TANH([orders].[profit])
  • TANH([orders].[sales])
  • TANH([orders].[order_discount])
  • TANH([orders].[shipping_cost])
  • TANH([product].[total_discount])
TRUNC

The TRUNC function, short for truncate, is a mathematical function used to remove the decimal part of a number, leaving only the integer part. It essentially rounds towards zero, discarding any digits to the right of the decimal point without rounding.

Syntax – trunc(column, precision)

Example: Here we are removing the decimal part of sales values.

Example Queries:

  • TRUNC([orders].[profit], 2)
  • TRUNC([orders].[sales], 1)
  • TRUNC([orders].[order_discount], 0)
  • TRUNC([orders].[shipping_cost], 3)
  • TRUNC([product].[total_discount], 2)

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this Doc

Math function

Or copy link

CONTENTS