Amazon QuickSight – Ln
The ln() function in Amazon QuickSight is used to calculate the natural logarithm of a numeric expression.
Syntax
#Start# ln(expression) #End#
This function takes one argument
- expression: This is the numeric expression whose natural logarithm is to be calculated.
Suppose we have a dataset that contains information about the revenue generated by a company over the last five years. We can use the ln() function in Amazon QuickSight to calculate the natural logarithm of the revenue data.
To calculate the natural logarithm of the revenue data, we can create a new calculated field in Amazon QuickSight with the following expression:
Example
#Start# ln(revenue) #End#
This expression will calculate the natural logarithm of the revenue column in our dataset.
For instance, if our revenue data is as follows:
| Year | Revenue |
| 2017 | 100000 |
| 2018 | 150000 |
| 2019 | 200000 |
| 2020 | 250000 |
| 2021 | 300000 |
Then, the natural logarithm of the revenue data will be:
| Year | Revenue | ln(Revenue) |
| 2017 | 100000 | 11.51292546 |
| 2018 | 150000 | 11.91839057 |
| 2019 | 200000 | 12.20607265 |
| 2020 | 250000 | 12.4292162 |
| 2021 | 300000 | 12.61153893 |
In this example, we can see that the natural logarithm of the revenue data increases as the revenue increases.