---
updatedAt: 2026-04-16T21:23:00.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# left

```
left(value: string, length: int64) -> string
```

Returns the leftmost `length` Unicode characters of `value`. If `value` or `length` is null, the result is null. A negative length is clamped to zero, producing an empty string. When `length` exceeds the string length, the whole string is returned.

# Domain

This is a scalar function (calculates a single output value for a single input row).

# Categories

* [String](function#string-functions)

# Examples

<OpalCodeBlock code={
`make_col short_id: left(trace_id, 8)
`}/>

Takes the first eight Unicode characters from each trace identifier for compact display.