---
title: "lcm function in Strata | Oplema"
description: "Calculate the least common multiple of two integers, the smallest number both divide into. For example, lcm(42, 57) returns 798."
url: "https://oplema.com/docs/strata/functions/lcm"
updated: "2026-11-04"
---

# lcm

Find the smallest whole number that two numbers both divide into exactly.

Also available as least\_common\_multiple.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **BIGINT**.

### Expression

```
lcm(42, 57)
```

### Result

```
798
```

To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | 798 |

## Arguments and types

```
lcm(x, y)
```

**x**

Number

**y**

Number

Supported signatures (2)

```
lcm(x: BIGINT, y: BIGINT) → BIGINT
lcm(x: HUGEINT, y: HUGEINT) → HUGEINT
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[least\_common\_multiple

Find the smallest whole number that two numbers both divide into exactly.

](https://oplema.com/docs/strata/functions/least-common-multiple)[gcd

Find the largest whole number that divides two numbers exactly.

](https://oplema.com/docs/strata/functions/gcd)[greatest\_common\_divisor

Find the largest whole number that divides two numbers exactly.

](https://oplema.com/docs/strata/functions/greatest-common-divisor)[acos

Computes the arccosine of x.

](https://oplema.com/docs/strata/functions/acos)

[Browse numbers](https://oplema.com/docs/strata/functions#numbers) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/numeric.html#lcmx-y)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
