/    /  Amazon QuickSight – Log

Amazon QuickSight – Log

 

The Amazon QuickSight LOG() function is used to compute the base 10 logarithm of a numeric expression.

Syntax

#Start#
LOG(expression)
#End#

 

This function takes one argument

 

  • expression: The numeric expression for which you want to compute the base-10 logarithm.

 

 

The function returns a numeric value representing the expression’s natural logarithm.

 

Here’s an example of how to use the LOG() function in Amazon QuickSight:

Example

#Start#
LOG(100)
#End#

 

In this example, the function will compute the base-10 logarithm of the numeric expression 100, which is 2.

 

You can also use a column reference or a more complex expression as the argument for the LOG() function. For example:

 

Example

#Start#
LOG(MyColumn * 2 + 1)
#End#

 

In this example, the function will compute the base-10 logarithm of the expression MyColumn * 2 + 1.

 

Note that if the expression parameter is not a positive number, the function will return an error.

 

Here’s an example of how to use the IF() function to handle negative or zero input values:

Example

#Start#
IF(MyColumn > 0, LOG(MyColumn), NULL)
#End#

 

In this example, the IF() function is used to check if the MyColumn value is greater than zero. If it is, the LOG() function is applied to the MyColumn value. Otherwise, the function returns NULL.