> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-openapi-sync-dataflows.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Magic ETL Tiles: Pivot

export const InlineImage = ({src, alt = '', height = '1.6em'}) => {
  return <img noZoom src={src} alt={alt} style={{
    display: 'inline',
    verticalAlign: 'start',
    height: height,
    margin: '0'
  }} />;
};

### Intro

There are three available tiles under **Pivot** in Magic ETL:

* Dynamic Unpivot
* Pivot
* Unpivot

Learn what it means to [pivot a table](#video) in the video below.

Learn how to [Create a Magic ETL DataFlow](/s/article/360055259234 "Creating a Magic ETL DataFlow").

<Warning>
  <Frame>
    <img alt="Pivot_Tiles.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/Ngw9EP6XM24-mr0f/images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNig.png?fit=max&auto=format&n=Ngw9EP6XM24-mr0f&q=85&s=b9c37dfe23a711607c6e26c3116707cc" width="283" height="267" data-path="images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNig.png" />
  </Frame>
</Warning>

***

### Dynamic Unpivot Tile

<Frame>
  <img alt="Dynamic_Unpivot.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/Ngw9EP6XM24-mr0f/images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNj0.png?fit=max&auto=format&n=Ngw9EP6XM24-mr0f&q=85&s=91f3e0832787a5a633f9cd58909e00d8" width="110" height="97" data-path="images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNj0.png" />
</Frame>

The Dynamic Unpivot tile lets you "unpivot" or normalize data in tables, transforming multiple columns in a single row into a single column with multiple rows. This tile is good in situations where the number of columns could potentially change. As columns are added, the Dynamic Unpivot tile automatically unpivotsthem.

##### Example

For example, the Dynamic Unpivot tile converts data where two products (Product A and Product B) appear in separate columns...

<Frame>
  <img alt="download.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/Ngw9EP6XM24-mr0f/images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNip.png?fit=max&auto=format&n=Ngw9EP6XM24-mr0f&q=85&s=563aeefd9457fd2ba9224bb0b7b203d4" width="754" height="186" data-path="images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNip.png" />
</Frame>

... to data where all products appear in the same column...

<Frame>
  <img alt="download__1_.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/Ngw9EP6XM24-mr0f/images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNib.png?fit=max&auto=format&n=Ngw9EP6XM24-mr0f&q=85&s=8c0f10590281c6e60186dc7c62297aed" width="750" height="306" data-path="images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNib.png" />
</Frame>

In this image, a third product (Product C) has been added to the `Product` column.

<Frame>
  <img alt="download__2_.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/Ngw9EP6XM24-mr0f/images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNie.png?fit=max&auto=format&n=Ngw9EP6XM24-mr0f&q=85&s=98a551dde3532718fc8fbc816397fea0" width="753" height="420" data-path="images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNie.png" />
</Frame>

The following configuration was used to achieve the results above.

* In step 1 of the Dynamic Unpivot tile editor, choose **Month**. This column is not pivoted.
* In step 2, name the column that will hold the pivoted column names. In this example, this column name is `Product.`
* In step 3, name the column that will hold the pivoted column values. In this example, this column name is `Sales.`

<Frame>
  <img alt="download__3_.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/Ngw9EP6XM24-mr0f/images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNiS.png?fit=max&auto=format&n=Ngw9EP6XM24-mr0f&q=85&s=3c91c22971c53205319bec120cfd9592" width="631" height="402" data-path="images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNiS.png" />
</Frame>

Follow these steps to configure the Dynamic Unpivot tile:

1. Drag the **Dynamic** **Unpivot** tile to the canvas and connect it to the rest of your flow.
2. (Optional) Rename the tile. In the **Configuration** tab of the tile editor, select <InlineImage src="/images/kb/ka05w00000122yV-00N5w00000Ri7BU-0EM5w000005vNgL.png" /> **Edit**.

   <Frame>
     <img alt="edit tile name.jpg" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/Ngw9EP6XM24-mr0f/images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EMVq000002MxQ5.jpg?fit=max&auto=format&n=Ngw9EP6XM24-mr0f&q=85&s=542d1668fc8aaa5f968a8a9513fec3c6" width="1013" height="239" data-path="images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EMVq000002MxQ5.jpg" />
   </Frame>
3. In step 1 of the tile editor, enter the name of the column that you DO NOT want to be pivoted. This will duplicate the value in this row per column that is being pivoted.
4. In step 2, name the column you want to create to contain the column headings from the columns to unpivot.
5. In step 3, name the column you want to create to contain the row values from the columns to be unpivoted.

Now, each new column added to this DataSet will automatically be pivoted unless you add it to Step 1 (these columns are not pivoted.)

<Tip>
  **Tip:** You can preview the data transformed by a tile by running a preview, clicking the tile in the canvas, then clicking the **Preview** tab.
</Tip>

### Pivot Tile

<Frame>
  <img src="https://mintcdn.com/domoinc-openapi-sync-dataflows/Ngw9EP6XM24-mr0f/images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNiU.png?fit=max&auto=format&n=Ngw9EP6XM24-mr0f&q=85&s=231a20321bab46b2bfcbb21bd6bf9d5f" width="83" height="98" data-path="images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNiU.png" />
</Frame>

The Pivot tile lets you "pivot" or de-normalize data in tables using key-value pairs, transforming a single column with multiple rows into multiple columns in a single row.

<Note>
  **Note:** If you create a table that reaches the 1500-column limit, you will receive an error. You must reduce the number of columns to continue running your Magic ETL DataFlow.
</Note>

**Example**

For example, the Pivot tile converts data where products A, B, and C are in the same column...

<Frame>
  <img alt="etl_rowdenormalizer_datain.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/YY6W1U347GpqLSJS/images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNhH.png?fit=max&auto=format&n=YY6W1U347GpqLSJS&q=85&s=a985a60883f2c90bacaa7320f9d04859" width="319" height="410" data-path="images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNhH.png" />
</Frame>

... to data where products A, B, and C each have their own column.

<Frame>
  <img alt="etl_rowdenormalizer_dataout.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/YY6W1U347GpqLSJS/images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNi9.png?fit=max&auto=format&n=YY6W1U347GpqLSJS&q=85&s=a0950ec8aa9df2c9195179c8db351a82" width="449" height="214" data-path="images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNi9.png" />
</Frame>

The following configuration was used to achieve the results above.

* In step 1 of the Pivot tile editor, choose **Product**.
* In step 2, select the column(s) that identify a row. In this example, the column is `Month.`
* In step 3, name the new column(s) to create. In this example, three columns are created, `Product A,` `Product B,` and `Product C.`
* In step 4, provide the label that identifies the rows that belong in each new column. In this example, the labels are `A,` `B,` and `C.`
* In step 5, select what column values will populate the new column. In this example, the column for each product is `Sales.`

<Frame>
  <img alt="etl_rowdenormalizer_sampleui.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/YY6W1U347GpqLSJS/images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNhF.png?fit=max&auto=format&n=YY6W1U347GpqLSJS&q=85&s=5522722f39fd385cebfbece313fb2b62" width="710" height="372" data-path="images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNhF.png" />
</Frame>

Follow these steps to configure the Pivot tile:

1. Drag the **Pivot** tile to the canvas and connect it to the rest of your flow.
2. (Optional) Rename the tile. In the **Configuration** tab of the tile editor, select <InlineImage src="/images/kb/ka05w00000122yV-00N5w00000Ri7BU-0EM5w000005vNgL.png" /> **Edit**.
3. Enter the name of the key column you want to pivot into new column headers.

   For example, "Product".
4. Select the column to use to group the row values of the new columns.

   For example, "Month".
5. For each new column you want to create from the key column, do the following:

   1. Enter the name of the new column header.

      For example, "Product A".
   2. Enter a value from the key column that represents the column header to be pivoted.

      For example, "A".
   3. Select the value column to use to fill the row value of the new column.
   4. For example, "Sales".

   <Note>
     **Note:** For each column you add to be pivoted, select the same value column.
   </Note>

   5. (Conditional) If you want to add another column, then click **Add Column**.

      <Tip>
        **Tip:** You can preview the data transformed by a tile by running a preview, clicking the tile in the canvas, then viewing the **Preview** tab.
      </Tip>

### Unpivot Tile

<Frame>
  <img src="https://mintcdn.com/domoinc-openapi-sync-dataflows/Ngw9EP6XM24-mr0f/images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNj4.png?fit=max&auto=format&n=Ngw9EP6XM24-mr0f&q=85&s=b2537378367c960bcedea22330182e9c" width="79" height="97" data-path="images/kb/ka0Vq0000001kYf-00N5w00000Ri7BU-0EM5w000005vNj4.png" />
</Frame>

The Unpivot tile lets you "unpivot" or "normalize" data in tables, transforming multiple columns in a single row into a single column with multiple rows. This action is useful only for unpivoting data in which the number of columns stays the same. If you add another column of data to the original file, this action does not unpivot the new column.

**Example**

For example, the Unpivot tile converts data in this pivoted format...

<Frame>
  <img alt="etl_rownormalizer_datain.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/YY6W1U347GpqLSJS/images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNi7.png?fit=max&auto=format&n=YY6W1U347GpqLSJS&q=85&s=e1b156a503324afd0a1976a825bc14ce" width="446" height="214" data-path="images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNi7.png" />
</Frame>

... to data in this format...

<Frame>
  <img alt="etl_rownormalizer_dataout.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/YY6W1U347GpqLSJS/images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNi3.png?fit=max&auto=format&n=YY6W1U347GpqLSJS&q=85&s=a6d7249b475fdf7cbd9401ceadfa7be3" width="319" height="410" data-path="images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNi3.png" />
</Frame>

... using this configuration:

<Frame>
  <img alt="etl_rownormalizer_sampleui.png" src="https://mintcdn.com/domoinc-openapi-sync-dataflows/YY6W1U347GpqLSJS/images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNh2.png?fit=max&auto=format&n=YY6W1U347GpqLSJS&q=85&s=47a686538d7624d624cd13271354f9f9" width="615" height="418" data-path="images/kb/ka05w00000124U6-00N5w00000Ri7BU-0EM5w000005vNh2.png" />
</Frame>

**To configure the Unpivot tile,**

1. Click the **Unpivot** tile in the canvas.
2. (Optional) Rename the tile by clicking
   <InlineImage src="/images/kb/ka05w00000122yV-00N5w00000Ri7BU-0EM5w000005vNgL.png" />, then entering the name you want.
3. Enter the name of the column you want to create to contain the column headings from the columns to unpivot.

   For example, "Product".
4. Enter the name of the column you want to create to contain the row values from the columns to be unpivoted.

   For example, "Sales".
5. For each column you want to unpivot, do the following:

   1. Select a column to normalize.

      For example, "Product A".
   2. Enter a value representing the column header to be normalized.

      The value appears in the row of the new column. For example, "A".
   3. (Conditional) If you want to unpivot another column, then click **Add Column**.

      <Tip>
        **Tip:** You can preview the data transformed by a tile by running a preview, clicking the tile in the canvas, then clicking the **Preview** tab.
      </Tip>

### What it Means to Pivot a Table (video)

<iframe allowfullscreen="allowfullscreen" frameborder="1" height="315" src="//www.youtube-nocookie.com/embed/F77TK52_VOg" width="560" />
