---
title: "struct_position function in Strata | Oplema"
description: "Find the position of a value in an unnamed struct, starting at 1. For example, struct_position(row(1, 2, 3), 2) returns 2."
url: "https://oplema.com/docs/strata/functions/struct-position"
updated: "2026-11-04"
---

# struct\_position

Find the position of a value in an unnamed struct, starting at 1.

Also available as struct\_indexof.

## Try an expression

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

### Expression

```
struct_position(row(1, 2, 3), 2)
```

### Result

```
2
```

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

## Arguments and types

```
struct_position(struct, entry)
```

**struct**

Struct

**entry**

Any value

Supported signatures (1)

```
struct_position(struct: STRUCT, 'entry': ANY) → INTEGER
```

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

[struct\_extract\_at

Get one entry from a struct by position, starting at 1.

](https://oplema.com/docs/strata/functions/struct-extract-at)[row

Create an unnamed struct from its arguments.

](https://oplema.com/docs/strata/functions/row)[struct\_contains

Check whether an unnamed struct contains a value.

](https://oplema.com/docs/strata/functions/struct-contains)[struct\_extract

Get one entry from a struct by name, or by position starting at 1 in an unnamed struct.

](https://oplema.com/docs/strata/functions/struct-extract)

[Browse structs](https://oplema.com/docs/strata/functions#structs) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/struct.html#struct_positionstruct-entry)

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