Tableau Function Categories
Tableau : Number Functions
Tableau Function: LN
Category: Number Functions
The LN() function in Tableau is a mathematical function that returns the natural logarithm (base e) of a given numeric expression.
In mathematical terms, it computes:
LN(x) = loge(x)
where e (Euler’s number) ≈ 2.71828.
Purpose
The purpose of the LN() function is to analyze data that follows an exponential pattern or convert multiplicative relationships into additive ones for easier modeling and visualization.
It is particularly useful for:
Transforming skewed data into a linear scale.
Modeling growth rates or decay processes (like interest, population, or depreciation).
Statistical and financial analyses involving exponential relationships.
Type of Calculations It Performs
Category: Mathematical / Statistical
Operation: Computes the natural logarithm (base e) of a positive numeric value.
Used For: Logarithmic transformations, growth modeling, and normalization.
Practical Use Cases
Data normalization — reducing skewness in numeric data for better trend visualization.
Growth analysis — analyzing exponential growth (e.g., population, investments).
Regression modeling — linearizing exponential data for predictive modeling.
Financial analytics — converting compounded rates to continuously compounded rates.
Scientific calculations — dealing with decay rates, reaction kinetics, or signal processing.
LN(expression)
| Parameter | Type | Description |
|---|---|---|
expression | Numeric (scalar, table, or column) | The positive numeric value or field for which the natural logarithm is to be calculated. Must be greater than 0. |
How It Works?
The LN() function applies the mathematical formula:
LN(x) = loge(x)
where e ≈ 2.71828 (Euler’s constant).
It represents the power to which e must be raised to obtain x.
For example:
LN(e) = 1 because e1 = e
LN(1) = 0 because e0 = 1
LN(10) ≈ 2.3026 because e2.3026 ≈ 10
Important Mathematical Note:
The function is undefined for x ≤ 0, and Tableau will return a NULL value in such cases.
What Does It Return?
Type: Floating-point number
Meaning: Returns the natural logarithm (base e) of the input value.
If the input is less than or equal to zero, the result is NULL because the logarithm is undefined for non-positive numbers.
When Should We Use It?
Use the LN() function when:
You’re performing exponential or logarithmic transformations.
You need to analyze proportional or percentage growth (e.g., returns, rates).
You want to normalize or linearize data for modeling.
You’re computing continuous compounding in finance:
A = Pert ⇒ LN ( A / P ) = rt
You’re comparing growth across different magnitudes (e.g., regional sales).
Basic Usage
LN(10)
Result: 2.302585
Explanation: The natural logarithm of 10 is approximately 2.3026.
LN([Sales])
Description: Returns the natural logarithm of each value in the [Sales] field.
Useful for normalizing sales data that spans several orders of magnitude.
| Sales | LN(Sales) |
|---|---|
| 100 | 4.60517 |
| 500 | 6.21461 |
| 1000 | 6.90776 |
Advanced Usage (Combining with EXP and Aggregations)
EXP(LN([Revenue]))
Result: Returns [Revenue] — since EXP( LN( x ) ) = x.
Used to reverse a logarithmic transformation.
Or, to compute a continuous growth rate:
(LN([Ending Value]) - LN([Starting Value])) / [Time Period]
This formula calculates the average continuous growth rate over time.
Tips and Tricks
Use
LN()to stabilize variance or reduce data skewness before visualization.Combine with
EXP()to model exponential growth and decay processes.When comparing growth rates, the difference between natural logs approximates a percentage change:
Growth Rate ≈ LN (Valuet) − LN (Valuet−1)
- Input must be > 0. Tableau will return NULL for 0 or negative inputs.
- Avoid applying
LN()directly to raw categorical or mixed data fields.
Related Functions You Might Need
| Function | Purpose |
|---|---|
LOG() | Returns the logarithm of a number with a specified base (e.g., base 10 or 2). |
EXP() | Returns e raised to the power of the specified number (inverse of LN). |
POWER() | Raises a number to a specified power (useful in exponential calculations). |
SQRT() | Returns the square root of a number. |
ABS() | Returns the absolute value, useful before applying LN() to positive-only data. |
We’ve got plenty of resources to help you master Tableau functions. For more details, check out the official Tableau documentation. Or, if you’re ready for more practice, let’s dive into related functions and build your Tableau skills further!
If you’re ready to harness the full power of Tableau and elevate your data analytics capabilities, our expert Tableau consulting services are here to guide you. Whether you need support with building advanced calculated fields, creating dynamic visual dashboards, or optimizing your data sources for peak performance, our team of experienced Tableau consultants delivers customized solutions designed for your business needs. Visit our Tableau Consulting page to discover how we can help your organization turn data into impactful, insight-driven decisions.
It returns the natural logarithm (base e) of a positive numeric value.
No. LN() is only defined for positive numbers. Tableau returns NULL for zero or negative inputs.
LN() uses base e (≈2.71828), while LOG() allows you to specify a custom base (e.g., 10 or 2).
Use EXP(). Since EXP(LN(x)) = x, it restores the original value.
Use LN() for continuous growth models, exponential functions, or when working with natural exponential relationships.
Established in 2020, Lets Viz Technologies provides a full range of high-quality data analysis and data visualization services. We are also an authorized Zoho Partner.
Sitelinks
