> 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/version-1.66/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/4abGQsrbZ2Mvi67u8eMG" alt=""><figcaption></figcaption></figure>

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

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