---
title: "yearweek function in Strata | Oplema"
description: "Combine the ISO year and week number into one number, such as 199207 for week 7 of 1992. Write it as yearweek(ts) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/yearweek"
updated: "2026-11-04"
---

# yearweek

Combine the ISO year and week number into one number, such as 199207 for week 7 of 1992.

## Try an expression

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

### Expression

```
yearweek(DATE '1992-02-15')
```

### Result

```
199207
```

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 | 199207 |

## Arguments and types

```
yearweek(ts)
```

**ts**

Date, Interval, Timestamp

Supported signatures (4)

```
yearweek(ts: DATE) → BIGINT
yearweek(ts: INTERVAL) → BIGINT
yearweek(ts: TIMESTAMP WITH TIME ZONE) → BIGINT
yearweek(ts: TIMESTAMP) → BIGINT
```

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

[century

Get the century from a date or timestamp, such as 20 for 1992.

](https://oplema.com/docs/strata/functions/century)[day

Get the day of the month, from 1 to 31, from a date or timestamp.

](https://oplema.com/docs/strata/functions/day)[dayofmonth

Get the day of the month, from 1 to 31, from a date or timestamp.

](https://oplema.com/docs/strata/functions/dayofmonth)[dayofweek

Get the day of the week as a number, where Sunday is 0 and Saturday is 6.

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

[Browse dates & times](https://oplema.com/docs/strata/functions#dates-&-times) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/datepart.html#yearweekdate)

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