# MV_SLICE

The `MV_SLICE` function extracts a subset of a multivalued field based on specified start and end index values. It is particularly useful when working with functions that produce multivalued columns in a known order, such as `SPLIT` or `MV_SORT`. It allows access of specific elements in the multivalue field array..

## Syntax

`MV_SLICE(field, start, end)`

### Parameters

#### field

This is a multivalue expression. If `null`, the function will return `null`.

#### start

This is the start position. If `null`, the function will return `null`. The start argument can be negative, where an index of -1 is used to specify the last value in the list.

#### end

This is the end position (included). This parameter is optional; if omitted, the position at `start` is returned. The end argument can be negative, where an index of -1 is used to specify the last value in the list.

## Examples

```esql
ROW a = [1, 2, 2, 3]
| EVAL a1 = MV_SLICE(a, 1), a2 = MV_SLICE(a, 2, 3)
```

```esql
ROW a = [1, 2, 2, 3]
| EVAL a1 = MV_SLICE(a, -2), a2 = MV_SLICE(a, -3, -1)
```
