Forum Discussion

lekkerbek's avatar
lekkerbek
Helper IV
6 years ago
Solved

Unpivot columns

Hi,

 

The solution is probably easy, but I can't get it to work as the outcome is not the same if I manually calculate.

 

I have an excelsheet covering the following:

 

Article nrArticle group0-30 number0- 30 value31-60 number31-60 value61-90 number61-90 value
001Article name1€ 10,505€ 52,502€ 21

 

I would like it to look like:

 

Article nrArticle groupAgeNumberValue
001Article name0-301€ 10,50
001Article name31-605€ 52,50
001Article name61-902€ 21

 

Could someone help me with this please? When I tried unpivotting I got duplicates and when I tried to remove those I apparantly removed too much as the total sum did not match the excelsheet anymore.

 

 

 

Thanks in advance. 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi lekkerbek ,

     

    Please follow the below steps to acheive your request. 

    • First Unpivot the columns Fig 1.1
    • Split the columns based on space delimiter to the Right-most delimiter Fig 1.2 and 1.3.
    • Pivot the Number and Values to columns based on Value column Fig1.4.


    Fig 1.1:

    Fig 1.2:

    Fig 1.3:

    Fig 1.4:

     


    Best Regards,
    Mail2inba4

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi lekkerbek ,

     

    Please follow the below steps to acheive your request. 

    • First Unpivot the columns Fig 1.1
    • Split the columns based on space delimiter to the Right-most delimiter Fig 1.2 and 1.3.
    • Pivot the Number and Values to columns based on Value column Fig1.4.


    Fig 1.1:

    Fig 1.2:

    Fig 1.3:

    Fig 1.4:

     


    Best Regards,
    Mail2inba4

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • lekkerbek ,

    You want something like below screen shot? (I tried to replica your requirement at my side)

    Please Give KUDOS to my post and accept this as a solution if it helps you!

     

     

     

     

      • lekkerbek's avatar
        lekkerbek
        Helper IV

        The number column should reflect the number of articles in stock. The value column reflects the total value of the stock of that article. Those two can't be combined into one column.