> For the complete documentation index, see [llms.txt](https://docs.nedyx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nedyx.com/nedyx/clearlines-functions/range-functions/unpivot.md).

# UNPIVOT

#### Syntax

**UNPIVOT**(*range; headerRange; numRowElements*)

1. *range* - the range whose content should be converted from a pivot structure into a row-based structure - ***Value type**: a range of any data*
2. *headerRange* - a range containing the column attributes of the pivot range - ***Value type**: a range of any data*
3. *numRowElements* - specifies how many starting columns from *range* should be used for the rows of the result range - ***Value type**: integer (optional, default value: 1)*

#### Remark <a href="#remarks.30" id="remarks.30"></a>

* The function converts the pivot structure of *range* into a row-based structure, with the help of the attribute names of *headerRange*.

#### Examples

**Example 1** - UNPIVOT with one attribute row and one attribute column (in the #header widget). The cell “Country” in the header is ignored, because it is assigned to the row attribute.

<figure><img src="/files/EdtUInUGLI0lCl82XDb1" alt=""><figcaption></figcaption></figure>

**Example 2** - UNPIVOT with two row attributes.

<figure><img src="/files/x2OGGb1eO5N8SVtPcJlF" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nedyx.com/nedyx/clearlines-functions/range-functions/unpivot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
