Skip to main content

PQL47 (PQL Function Library - CPM 4.7)

LOG

Applies to: CELONIS 4.2 CELONIS 4.3 CELONIS 4.4 CELONIS 4.5 CELONIS 4.6 CELONIS 4.7

Description

The LOG function returns the logarithm of the specified float expression.

By default, LOG() returns the natural logarithm, but you can specify the base with an optional parameter.

It can be applied to INT or FLOAT columns.

Syntax
LOG ( table.column [, base] )
NULL handling

If the input value is NULL, the result is NULL as well.

Examples

[1] Calculate the natural logarithm of an integer.

Query

Column1

log ( "Table1"."Column1" )

Input

Output

Table1

Column1 : INT

4

Result

Column1 : FLOAT

1.3862943611198906

[2] Calculate the logarithm of an integer with a given base.

Query

Column1

log ( "Table1"."Column1" , 2 )

Input

Output

Table1

Column1 : INT

4

Result

Column1 : FLOAT

2.0