# Create rows from columns

**URL:** <https://community.parabola.io/t/create-rows-from-columns/2470>\
**Category:** Ask a question\
**Tags:** Building-Flows\
**Created:** [August 15, 2022, 12:25pm UTC](https://community.parabola.io/t/create-rows-from-columns/2470 "2022-08-15T12:25:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesF](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JamesF](https://community.parabola.io/u/JamesF)\
**Post date:** [August 15, 2022, 12:25pm UTC](https://community.parabola.io/t/create-rows-from-columns/2470/1 "2022-08-15T12:25:14Z")

</div>

I have a customer code and 4 columns that contain product orders

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/a/a5e0aa673649c4d7c33796efef08a3b3dd1ea841.png)  
I need to create a csv with a line per customer code for each one of the product codes  
eg, if Customer 1234 wants 3 of each of the 4 colours, the table needs to create 4 rows for that customer, one for each product.

I cant work out how to generate rows from columns

---

<div class="post-metadata">

**Author:** ![Brian\_Dawson](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/brian_dawson/32/1454_2.png) [@Brian\_Dawson](https://community.parabola.io/u/Brian_Dawson)\
**Post date:** [August 15, 2022, 1:55pm UTC](https://community.parabola.io/t/create-rows-from-columns/2470/2 "2022-08-15T13:55:57Z")

</div>

Hey James,

There’s ways to get this done, it just depends on exactly how you want the resulting table to look.

**Option A**

Results looks like this:  
 ![Screen Shot 2022-08-15 at 9.46.07 AM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/e/ee5b7db655e67e9c4ba55adab6ce4056d267f056.png)

To get something like that, here’s what you’d do:

 ![Screen Shot 2022-08-15 at 9.47.58 AM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/1/107756b8cd3a75dece51e23cad2b7177392b4d11.png)

To break that down:

1. Take your separate columns of color quantities and create a new column that concatenates them altogether. (This will let us split into rows in future step)

 ![Screen Shot 2022-08-15 at 9.49.13 AM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/0/081b3a04d0fc02caf2da60cbb3b7b25c9c02c9c9.jpeg)

1. Remove the color columns that were in your source data

 ![Screen Shot 2022-08-15 at 9.49.55 AM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/c/cfb3d2d01ce2983bed7337428337be35bd29a809.png)

1. Split your new column into rows, on commas, so that each color:quantity pair gets its own row (but keeps the account number its associated with)

![Screen Shot 2022-08-15 at 9.50.59 AM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/b/bfb7853faac607a8594a02334b162b389d8aa94c.png)

1. Then, split the color:quantity pair into _columns_, on the colon character, so that quantity is in its own column.

 ![Screen Shot 2022-08-15 at 9.51.49 AM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/6/6515f1538ed0a8ce6e063e4e4d6476f1217bb97b.jpeg)

1. Then rename your columns for clarity.

**Option B**

The easier method, which might well do what you need, is to flip the table.

That will get you a result like this:

 ![Screen Shot 2022-08-15 at 9.53.35 AM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/8/8ea435cd1285bec15d93295d4a59638938a53b49.png)

This is all you’d need to do:

![Screen Shot 2022-08-15 at 9.53.10 AM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/f/f44a0d07b8b9b17260ba4cc4eb452a6d50857b68.png)

Hope that helps!

* * *

Brian Dawson  
Automation Consultant

---

<div class="post-metadata">

**Author:** ![JamesF](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JamesF](https://community.parabola.io/u/JamesF)\
**Post date:** [August 16, 2022, 1:06am UTC](https://community.parabola.io/t/create-rows-from-columns/2470/3 "2022-08-16T01:06:48Z")

</div>

Thanks Brian  
Option A worked fantastically and opened my eyes to a couple of other use cases as well.  
Appreciate your help
