---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/function-ref/TREE
  - ru/function-ref/TREE
  - href: en/function-ref/TREE.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/function-ref/TREE.html
editable: false
vcsPath: en/function-ref/TREE.md
---

# TREE



#### Syntax {#syntax}


```
TREE( array )
```

#### Description {#description}
Converts the `array` expression to `Tree of strings` format. Can be used to create [tree hierarchies](../dataset/data-types.md#tree-hierarchy).

**Argument types:**
- `array` — `Array of strings`


**Return type**: `Any`

#### Example {#examples}

```
TREE(ARRAY([Country], [Region], [City]))
```


#### Data source support {#data-source-support}

`ClickHouse 21.8`, `Files`, `Google Sheets`, `PostgreSQL 9.3`, `Trino`, `Yandex Documents`.
