Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Have each value in many dynamic columns stacked into one column

Hello,

 

I have an Excel table that is like this:

 

CategorySub-categorySub-sub-categoryProduct 1Product 2Product 3
VegetablesGreen vegetablesImported vegetablesCabbageKale 
FruitsTropical fruitsImported from BrazilCoconut  
VegetablesRoot vegetablesDomestic vegetablesPotatoTomatoCarrot

 

I want to have the outcome table like this:

CategorySub-categorySub-sub-categoryProduct
VegetablesGreen VegetablesImported vegetablesCabbage
VegetablesGreen VegetablesImported vegetablesKale

 

In the future, we will have plenty more products, so there will be more columns for example Product 4, Product 5, Product 6, Product 8, etc. I also want all the columns that start with "Product" be stacked this way into one column Product. 

 

How can I achieve this?

 

Thank you beforehand

  • Hi Anonymous ,

     

    Multi-select your [Category], [Sub-category], and [Sub-sub-category] fields.

    Go to Transform tab and select the dropdown button next to 'Unpivot Columns'.

    Select 'Unpivot Other Columns' from the dropdown list.

     

    this gives me the following output:

     

    You can then remove the [Attribute] field and filter out null values from the [Value] field and rename fields as appropriate.

     

    Pete

2 Replies

  • Hi Anonymous ,

     

    Multi-select your [Category], [Sub-category], and [Sub-sub-category] fields.

    Go to Transform tab and select the dropdown button next to 'Unpivot Columns'.

    Select 'Unpivot Other Columns' from the dropdown list.

     

    this gives me the following output:

     

    You can then remove the [Attribute] field and filter out null values from the [Value] field and rename fields as appropriate.

     

    Pete

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

       

      Thank you for your solution. It has worked great for me 🙂