# LOG
URL: https://docs.valsight.ai/log/
Description: This example calculates the logarithm of input values using a separate node to define the base for each year.
**Category:** [Math & numeric](/math-numeric/)

## Overview

The **LOG** function **returns the logarithm of a number** (first argument) **with respect to a base** (second argument), while retaining all dimensions.

Use this function when you need a logarithm with a specific base rather than the natural logarithm.

## Syntax

`LOG('Node1', 'Node2')`

## Parameters

| Parameter           | Description                                                                                                      | Type                     | Required |
| ------------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------ | -------- |
| **Value** (`Node1`) | The value for which to calculate the logarithm, specified using the node name in single quotes (e.g. `'Profit'`) | Node reference           | Yes      |
| **Base** (`Node2`)  | The base to use for calculation of the logarithm. The base can also be a standalone number.                      | Node reference or number | Yes      |

## Example

### Logarithm with a custom base

This example calculates the logarithm of input values using a separate node to define the base for each year.

**Input node:** `'Value'`

| Year | Value |
| ---- | ----- |
| 2025 | 2     |
| 2026 | 3     |
| 2027 | 4.5   |

**Input node:** `'Base'`

| Year | Value |
| ---- | ----- |
| 2025 | 2     |
| 2026 | 2     |
| 2027 | 2     |

**Formula:** `LOG('Value', 'Base')`

| Year | LOG Result |
| ---- | ---------- |
| 2025 | 1          |
| 2026 | 1.58       |
| 2027 | 2.17       |

## Related

| Function     | When to use instead                                                                |
| ------------ | ---------------------------------------------------------------------------------- |
| [LN](/ln/)   | When you need the natural logarithm instead of a logarithm with a custom base.     |
| [EXP](/exp/) | When you need exponentiation with base e rather than a logarithmic transformation. |
