Looker Studio Function : LOG

Category: Arithmetic function

The Log function in Looker Studio is a powerful analytical tool used to transform numerical data using logarithmic scales. With just a few clicks, you can simplify complex datasets, identify hidden patterns, and enhance decision-making processes through accurate visualization and segmentation.

Purpose of the Log Function

1. Data Distribution Analysis :

The log function helps reshape skewed data into a more normal distribution. By compressing larger values and spreading smaller ones, it allows analysts to better visualize and understand how data is spread out.

2. Customer Segmentation :
Log transformation assists in segmenting customers based on behaviors or spend patterns. It highlights differences in high-variance datasets, making it easier to categorize customers by their activity levels or purchase frequencies.

3. Decision Making :

Logarithmic scaling provides clearer insights into growth rates and relative differences. Decision-makers can identify trends or anomalies faster, leading to smarter strategies and more data-driven business actions.

Type of Calculation:

Use CaseDescription
Performance BenchmarkNormalizes performance data across products or time to compare growth rates
Customer Segmentation Helps in classifying customers based on log-scaled transactional data
Time Series AnalysisSmooths volatile data to reveal underlying trends and seasonal behaviors

LOG(X)

ParameterTypeDescription
XNumberThe positive numeric value to transform

How Does the LOG Function Work?

The Log function computes the natural logarithm (base e) or common logarithm (base 10) depending on your input. It transforms exponential or wide-ranging numeric data into a compact and interpretable form. This helps reduce data skew and highlights trends that are hard to see in raw format.


When Should You Use LOG?

  • When your data contains large outliers

  • If the dataset is not normally distributed

  • While comparing exponential growth (e.g., user signups, revenue)

  • To segment and rank entities with large numeric ranges

  • When preparing features for machine learning models

Example of  Log with Result

Example 1: Basic Usage

LOG(100)

Example 2: Column Usage 

LOG(Sales_Amount)

Example 3: Handling Decimals and Scientific Notation

LOG(0.01) → -2

Example 4: Combining with Other Functions

ROUND(LOG(Revenue), 2)

Tips and Tricks

    • Use LOG() with histograms to visualize skewed data clearly.

    • Avoid using log on zero or negative numbers—it will return errors or NULL.

    • Pre-check data quality before applying the log transformation.

1. What is the difference between LOG and LN?

LOG() generally uses base 10; LN() is the natural log (base e).

2. Can I use LOG on negative values?

No, logarithms are only defined for positive numbers.

3. How do I handle null or zero values in LOG()?

Use conditional logic to avoid errors:

IF(Value > 0, LOG(Value), NULL)
4. Why is my log result negative?

When input is between 0 and 1, the logarithm is negative (e.g., LOG(0.1) = -1).

5. Can I apply LOG on aggregated fields?

Yes, but it’s more effective to log-transform values before aggregation.