Returns the logarithm of a number with respect to a base.
The mathematical base used by the LOG(X) function varies depending on the data source connector being used.
- For BigQuery and most other connectors,
LOG(X)computes the natural logarithm (base e). - For connectors such as Google Sheets, MySQL, PostgreSQL, Looker, and Extract Data,
LOG(X)may default to base 2.
The function LOG(X, base) with a second argument to specify the base is NOT supported.
Sample usage
LOG(256)
Syntax
LOG( value )
Parameter
value - The value for which to calculate the logarithm using base e (Euler's number). value must be a positive number.
Examples
| Example formula | Input | Output |
|---|---|---|
LOG(My field) |
2.718281828459045 | 1 |
LOG(My field) |
128 | 4.852030264 |