# Unnest

## Using the Unnest transformation to flatten your data

You can leverage the **Unnest** transformation to flatten your data. For instance, when you have multi-select options or comma-separated text values in your report, you can split your values into multiple rows.

Let's look at an example to demonstrate how the Unnest function works. Consider a table that captures the orders placed. The investment products purchased by each customer are separated by commas.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FYCvdMdGJA5iRUUJZuJM4%2Fimage.png?alt=media&#x26;token=d7011c1a-1a18-43e3-b9b6-6385aa5e4bbd" alt=""><figcaption><p>Orders table</p></figcaption></figure>

An account manager may need to add details specific to each investment instrument, like an interest rate. They would need each product in a separate row to enter the rates as shown below. This is where the Unnest function can be used.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FdOauiRoqXdNvBndlECUx%2Fimage.png?alt=media&#x26;token=f6de0fc0-72d2-4948-8323-27eb21102b2c" alt=""><figcaption><p>Flattened data</p></figcaption></figure>

Let's look at this Inforiver report that contains a multi-select data input field with benchmarks.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FRZWQmJcsh6mv9EwA61OW%2Fimage.png?alt=media&#x26;token=219351c7-46e0-4371-bf26-e34c6495351f" alt=""><figcaption><p>Inforiver report with multi-select options</p></figcaption></figure>

After importing the report into Infobridge and removing the Quarter column, let's apply the Unnest transformation. Choose Benchmark as the target column and comma as the delimiter.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FWaGKurFif1Y0bJK028xY%2Fimage.png?alt=media&#x26;token=bbb1c28f-5c02-48c6-a5c5-71940e90e39b" alt=""><figcaption><p>Unnest transformation in Infobridge</p></figcaption></figure>

Notice how each benchmark is flattened into a separate row. You can perform operations like creating a conditional column to set a rate for each benchmark.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FJsqn8qK6hMnw06GxTYzG%2Fimage.png?alt=media&#x26;token=eba18913-005a-4137-9825-6b7a05eba3ee" alt=""><figcaption><p>Output of Unnest transformation</p></figcaption></figure>
