Anilkumar Adepu

Anilkumar Adepu

  • NA
  • 15
  • 838

How to pivot columns data to rows

Jan 11 2023 8:19 AM

Hi team, i have a query where i need to swap columns data to rows. below is the example of table data and required format.

Table data:

Product size   manualSales     ScanningSales   TotalSales
AC                  0             0               0
AF                  0             0               0
AP                  0             0               0
BS                  0             0               0
CP                  0             219             219
DD                  0             2                2

Output

Product_Size    AC    AF    AP    BS    CP    DD    TotalSales
ScanningSales    0    0    0    0    219    0     219
ManualSales        0    0    0    0    0    2      2

Total                0    0    0    0    0    2     2  

Please help me opn this...

Note: In table product size column data doesnot fix as above ,sizes comes static in future.


Answers (3)