Version 2021

Math Function

MicroStrategy pushes the calculations for the following list of built-in math functions down to PostgreSQL using the associated SQL patterns.

Function

SQL Pattern or Example

Abs

ABS(#0)  

Acos

ACOS(#0)

Acosh

LN(#0+SQRT(#0-1)*SQRT(#0+1))

Asin

ASIN(#0)

Asinh

LN(#0+SQRT(POWER(#0,2)+1))

Atan

ATAN(#0) 

Atan2

ATN2(#1, #0)

Atanh

((LN(1+#0)-LN(1- #0))/2)

Ceiling

CEIL(#0) 

Cos

Cos(#0)

Degrees

Degrees(#0)

Exp

Exp(#0)

Floor

Floor(#0)

Int

Floor(#0)

Int2

Floor(#0)

Ln

LN(#0)

Log

LOG(#1, #0)

Log10

LOG(#0)

Mod

(#0-TRUNC((#0)/NULLIF(#1,0))*(#1))

Power

POWER(#0, #1)

Quotient

TRUNC((#0)/NULLIF(#1, 0))

Radians

RADIANS(#0)

Round

ROUND(#0)

Round2

ROUND(cast(#0 as numeric), cast(#1 as integer))

Sin

SIN(#0)

Sqrt

Sqrt(#0)

Tan

Tan(#0)

Trunc

TRUNC(#0)

RandBetween

((#1- #0)*RANDOM()+#0)

MicroStrategy uses the analytical engine to implement the math functions shown below.

Function Example of Analytical SQL Calculated by the Analytical Engine

Combine

Combine(WJXBFS1, 3.0)

Cosh

Cosh(WJXBFS1)

Factorial

Factorial(WJXBFS1)

Sinh

Sinh(WJXBFS1)

Tanh

Tanh(WJXBFS1)